Skip to content

Commit 794911a

Browse files
committed
[Plugin.Shell] Fix: The Query Box Is Not Focused When HotKey Invoked
1 parent 2e412a0 commit 794911a

File tree

1 file changed

+6
-1
lines changed
  • Plugins/Flow.Launcher.Plugin.Shell

1 file changed

+6
-1
lines changed

Plugins/Flow.Launcher.Plugin.Shell/Main.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,12 @@ bool API_GlobalKeyboardEvent(int keyevent, int vkcode, SpecialKeyState state)
298298
private void OnWinRPressed()
299299
{
300300
context.API.ChangeQuery($"{context.CurrentPluginMetadata.ActionKeywords[0]}{Plugin.Query.TermSeperater}");
301-
Application.Current.MainWindow.Visibility = Visibility.Visible;
301+
302+
// show the main window and set focus to the query box
303+
Window mainWindow = Application.Current.MainWindow;
304+
mainWindow.Visibility = Visibility.Visible;
305+
mainWindow.Activate();
306+
mainWindow.Focus();
302307
}
303308

304309
public Control CreateSettingPanel()

0 commit comments

Comments
 (0)