SteamController: Avoid deadlock when changing profile

This commit is contained in:
Kamil Trzciński 2023-01-04 12:33:27 +01:00
parent 2bd3e73c91
commit 2626e9bacf
2 changed files with 9 additions and 2 deletions

View file

@ -24,3 +24,4 @@
- Support SMU of Vangogh GPU shipped with BIOS 113
- Fix Steam Game detection when in X360 controller mode
- Hold-press Guide button for 100ms in X360 mode
- Avoid deadlock when changing profile

View file

@ -148,7 +148,7 @@ namespace SteamController
if (i != selectedProfile)
{
selectedProfile = i;
ProfileChanged(profile);
OnProfileChanged(profile);
}
return true;
}
@ -190,7 +190,7 @@ namespace SteamController
continue;
selectedProfile = idx;
ProfileChanged(profile);
OnProfileChanged(profile);
return true;
}
}
@ -204,5 +204,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)));
}
}
}