From ff21b77b7bdb12404b36412c225f0af355fb60c2 Mon Sep 17 00:00:00 2001 From: "Shawn Yuan (from Dev Box)" Date: Wed, 10 Dec 2025 11:39:40 +0800 Subject: [PATCH] bug fixing Signed-off-by: Shawn Yuan (from Dev Box) --- .../Settings.UI/SettingsXAML/MainWindow.xaml.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/settings-ui/Settings.UI/SettingsXAML/MainWindow.xaml.cs b/src/settings-ui/Settings.UI/SettingsXAML/MainWindow.xaml.cs index e318fd7ec5..40dac659b9 100644 --- a/src/settings-ui/Settings.UI/SettingsXAML/MainWindow.xaml.cs +++ b/src/settings-ui/Settings.UI/SettingsXAML/MainWindow.xaml.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for more information. using System; +using System.Threading.Tasks; using ManagedCommon; using Microsoft.PowerLauncher.Telemetry; using Microsoft.PowerToys.Settings.UI.Helpers; @@ -93,11 +94,13 @@ namespace Microsoft.PowerToys.Settings.UI // Save settings to file new SettingsUtils().SaveSettings(generalSettingsConfig.ToJsonString()); - this.DispatcherQueue.TryEnqueue(Microsoft.UI.Dispatching.DispatcherQueuePriority.Normal, () => + // Send IPC message asynchronously to avoid blocking UI and potential recursive calls + Task.Run(() => { ShellPage.SendDefaultIPCMessage(outgoing.ToString()); - ShellPage.ShellHandler?.SignalGeneralDataUpdate(); }); + + ShellPage.ShellHandler?.SignalGeneralDataUpdate(); } return needToUpdate;