From 3947dbc4ecf0d542deecfff9cd34a459fa5c1f04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Trzci=C5=84ski?= Date: Sat, 26 Nov 2022 12:15:38 +0100 Subject: [PATCH] Fix incorrect `CurrentProfile` in `SteamController` --- RELEASE.md | 1 + SteamController/Controller.cs | 10 +++------- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/RELEASE.md b/RELEASE.md index bc3871c..3cfaba2 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -2,6 +2,7 @@ - Introduce SteamController that provides 3 main modes of operation Desktop, X360 and Steam - Fix `FanControl` broken context menu +- Fix incorrect `CurrentProfile` of `SteamController` ## 0.4.x diff --git a/SteamController/Controller.cs b/SteamController/Controller.cs index 2a24d44..46827cf 100644 --- a/SteamController/Controller.cs +++ b/SteamController/Controller.cs @@ -154,15 +154,12 @@ namespace SteamController { if (sharedData.GetValue(out var value) && value.DesiredProfile != "") { - lock (context) - { - context.SelectProfile(value.DesiredProfile); - } + context.SelectProfile(value.DesiredProfile); } sharedData.SetValue(new SteamControllerSetting() { - CurrentProfile = context.Profiles.FirstOrDefault((profile) => profile.Selected(context))?.Name, + CurrentProfile = context.OrderedProfiles.FirstOrDefault((profile) => profile.Selected(context))?.Name ?? "", SelectableProfiles = context.Profiles.Where((profile) => profile.Selected(context) || profile.Visible).JoinWithN((profile) => profile.Name), }); } @@ -172,10 +169,9 @@ namespace SteamController lock (context) { context.Tick(); + SharedData_Update(); } - SharedData_Update(); - if (!context.Mouse.Valid) { notifyIcon.Text = TitleWithVersion + ". Cannot send input.";