gtk(command_palette): grab focus correctly

pull/7688/head
Leah Amelia Chen 2025-06-25 18:32:49 +02:00 committed by Mitchell Hashimoto
parent a5f1413a1c
commit 832f27596c
1 changed files with 1 additions and 2 deletions

View File

@ -94,9 +94,8 @@ pub fn deinit(self: *CommandPalette) void {
pub fn toggle(self: *CommandPalette) void { pub fn toggle(self: *CommandPalette) void {
self.dialog.present(self.window.window.as(gtk.Widget)); self.dialog.present(self.window.window.as(gtk.Widget));
// Focus on the search bar when opening the dialog // Focus on the search bar when opening the dialog
self.dialog.setFocus(self.search.as(gtk.Widget)); _ = self.search.as(gtk.Widget).grabFocus();
} }
pub fn updateConfig(self: *CommandPalette, config: *const configpkg.Config) !void { pub fn updateConfig(self: *CommandPalette, config: *const configpkg.Config) !void {