From afba3c01cc145646cf887a0c8b4f3406725f8d6d Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Sat, 5 Apr 2025 12:52:26 +0800 Subject: [PATCH] Initialize hotkey mapper after window is loaded --- Flow.Launcher/App.xaml.cs | 2 -- Flow.Launcher/MainWindow.xaml.cs | 3 +++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Flow.Launcher/App.xaml.cs b/Flow.Launcher/App.xaml.cs index f484d4dba..81938612c 100644 --- a/Flow.Launcher/App.xaml.cs +++ b/Flow.Launcher/App.xaml.cs @@ -179,8 +179,6 @@ namespace Flow.Launcher Current.MainWindow = _mainWindow; Current.MainWindow.Title = Constant.FlowLauncher; - HotKeyMapper.Initialize(); - // main windows needs initialized before theme change because of blur settings Ioc.Default.GetRequiredService().ChangeTheme(); diff --git a/Flow.Launcher/MainWindow.xaml.cs b/Flow.Launcher/MainWindow.xaml.cs index c62606743..6173fd8ce 100644 --- a/Flow.Launcher/MainWindow.xaml.cs +++ b/Flow.Launcher/MainWindow.xaml.cs @@ -173,6 +173,9 @@ namespace Flow.Launcher // Without this part, when shown for the first time, switching the context menu does not move the cursor to the end. _viewModel.QueryTextCursorMovedToEnd = false; + // Initialize hotkey mapper after window shown or hiden the first it is loaded + HotKeyMapper.Initialize(); + // View model property changed event _viewModel.PropertyChanged += (o, e) => {