From 2626e9bacfd1f7170097226d9f488fc886fe9b85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Trzci=C5=84ski?= Date: Wed, 4 Jan 2023 12:33:27 +0100 Subject: [PATCH] SteamController: Avoid deadlock when changing profile --- RELEASE.md | 1 + SteamController/Context.cs | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/RELEASE.md b/RELEASE.md index aad085e..07e087f 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -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 diff --git a/SteamController/Context.cs b/SteamController/Context.cs index 4ff585c..c8d7a88 100644 --- a/SteamController/Context.cs +++ b/SteamController/Context.cs @@ -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))); + } } }