SteamController: Avoid deadlock when changing profile

This commit is contained in:
Kamil Trzciński 2023-01-04 12:33:27 +01:00
parent 415cd477e6
commit 082dede416
2 changed files with 9 additions and 3 deletions

View file

@ -30,5 +30,5 @@
- GPU detection will log errors to `Sentry.io`
- Support SMU of Vangogh GPU shipped with BIOS 113
- Fix Steam Game detection when in X360 controller mode
- Force to reconnect X360 controller on Resume
- Force to reconnect X360 controller on Resume (deadlock)
- Hold-press Guide button for 100ms in X360 mode

View file

@ -153,7 +153,7 @@ namespace SteamController
selectedProfile = i;
if (!profile.IsDesktop && !userDefault)
controllerProfile = i;
ProfileChanged(profile);
OnProfileChanged(profile);
}
return true;
}
@ -205,7 +205,7 @@ namespace SteamController
selectedProfile = idx;
controllerProfile = idx;
ProfileChanged(profile);
OnProfileChanged(profile);
return true;
}
}
@ -219,5 +219,11 @@ namespace SteamController
if (SelectDefault is not null)
SelectDefault();
}
private void OnProfileChanged(Profiles.Profile profile)
{
System.Windows.Threading.Dispatcher.CurrentDispatcher.BeginInvoke(
new Action(() => ProfileChanged(profile)));
}
}
}