diff --git a/Flow.Launcher/CustomQueryHotkeySetting.xaml.cs b/Flow.Launcher/CustomQueryHotkeySetting.xaml.cs index d036c008c..813c5e254 100644 --- a/Flow.Launcher/CustomQueryHotkeySetting.xaml.cs +++ b/Flow.Launcher/CustomQueryHotkeySetting.xaml.cs @@ -55,7 +55,7 @@ namespace Flow.Launcher SetHotkey(ctlHotkey.CurrentHotkey, delegate { App.API.ChangeQuery(pluginHotkey.ActionKeyword); - Application.Current.MainWindow.Visibility = Visibility.Visible; + ShowMainWindow(); }); } else @@ -73,11 +73,18 @@ namespace Flow.Launcher SetHotkey(new HotkeyModel(updateCustomHotkey.Hotkey), delegate { App.API.ChangeQuery(updateCustomHotkey.ActionKeyword); - Application.Current.MainWindow.Visibility = Visibility.Visible; + ShowMainWindow(); }); } Close(); + + static void ShowMainWindow() + { + Window mainWindow = Application.Current.MainWindow; + mainWindow.Visibility = Visibility.Visible; + mainWindow.Focus(); + } } public void UpdateItem(CustomPluginHotkey item) diff --git a/Plugins/Flow.Launcher.Plugin.Shell/Main.cs b/Plugins/Flow.Launcher.Plugin.Shell/Main.cs index fe6726d57..58f8538f0 100644 --- a/Plugins/Flow.Launcher.Plugin.Shell/Main.cs +++ b/Plugins/Flow.Launcher.Plugin.Shell/Main.cs @@ -302,7 +302,6 @@ namespace Flow.Launcher.Plugin.Shell // show the main window and set focus to the query box Window mainWindow = Application.Current.MainWindow; mainWindow.Visibility = Visibility.Visible; - mainWindow.Activate(); mainWindow.Focus(); }