From 3db201f4a3c540e40cdefab84c1f812db25f5910 Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Sun, 1 Mar 2026 14:00:07 +0800 Subject: [PATCH] Use DispatcherPriority.Render for theme UI updates Explicitly set DispatcherPriority.Render when invoking RefreshFrameAsync and SetBlurForWindowAsync on the application's dispatcher. This ensures theme-related UI changes are processed with rendering priority, improving responsiveness and visual consistency. Also added System.Windows.Threading import for access to DispatcherPriority. --- Flow.Launcher.Core/Resource/Theme.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Flow.Launcher.Core/Resource/Theme.cs b/Flow.Launcher.Core/Resource/Theme.cs index e0f3368f8..b7b137d91 100644 --- a/Flow.Launcher.Core/Resource/Theme.cs +++ b/Flow.Launcher.Core/Resource/Theme.cs @@ -16,6 +16,7 @@ using Flow.Launcher.Infrastructure.UserSettings; using Flow.Launcher.Plugin; using Flow.Launcher.Plugin.SharedModels; using Microsoft.Win32; +using System.Windows.Threading; namespace Flow.Launcher.Core.Resource { @@ -692,7 +693,7 @@ namespace Flow.Launcher.Core.Resource if (Application.Current == null) return; if (!Application.Current.Dispatcher.CheckAccess()) { - await Application.Current?.Dispatcher.InvokeAsync(RefreshFrameAsync); + await Application.Current?.Dispatcher.InvokeAsync(RefreshFrameAsync, DispatcherPriority.Render); return; } @@ -725,7 +726,7 @@ namespace Flow.Launcher.Core.Resource if (Application.Current == null) return; if (!Application.Current.Dispatcher.CheckAccess()) { - await Application.Current?.Dispatcher.InvokeAsync(SetBlurForWindowAsync); + await Application.Current?.Dispatcher.InvokeAsync(SetBlurForWindowAsync, DispatcherPriority.Render); return; }