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.
This commit is contained in:
Jack251970 2026-03-01 14:00:07 +08:00
parent 9943b72839
commit 3db201f4a3

View file

@ -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;
}