Skip to content

Commit 6bb638b

Browse files
committed
Fix window blink issue
1 parent 836d09e commit 6bb638b

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

Flow.Launcher/App.xaml.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,9 @@ await API.StopwatchLogInfoAsync(ClassName, "Startup cost", async () =>
182182
Current.MainWindow = _mainWindow;
183183
Current.MainWindow.Title = Constant.FlowLauncher;
184184

185+
// Initialize hotkey mapper instantly after main window is created because it will steal focus from main window
186+
HotKeyMapper.Initialize();
187+
185188
// main windows needs initialized before theme change because of blur settings
186189
Ioc.Default.GetRequiredService<Theme>().ChangeTheme();
187190

Flow.Launcher/MainWindow.xaml.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
using CommunityToolkit.Mvvm.DependencyInjection;
1717
using Flow.Launcher.Core.Plugin;
1818
using Flow.Launcher.Core.Resource;
19-
using Flow.Launcher.Helper;
2019
using Flow.Launcher.Infrastructure;
2120
using Flow.Launcher.Infrastructure.Hotkey;
2221
using Flow.Launcher.Infrastructure.Image;
@@ -174,9 +173,6 @@ private async void OnLoaded(object sender, RoutedEventArgs _)
174173
// Set the initial state of the QueryTextBoxCursorMovedToEnd property
175174
// Without this part, when shown for the first time, switching the context menu does not move the cursor to the end.
176175
_viewModel.QueryTextCursorMovedToEnd = false;
177-
178-
// Initialize hotkey mapper after window is loaded
179-
HotKeyMapper.Initialize();
180176

181177
// View model property changed event
182178
_viewModel.PropertyChanged += (o, e) =>

0 commit comments

Comments
 (0)