mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-14 15:56:13 +03:00
gtk: don't allow focusing on tab overview or menu buttons (#7826)
This prevents GTK from focusing on those buttons, which would prevent focus from returning to the terminal after those buttons had been used.
This commit is contained in:
@ -214,6 +214,7 @@ pub fn init(self: *Window, app: *App) !void {
|
|||||||
{
|
{
|
||||||
const btn = gtk.MenuButton.new();
|
const btn = gtk.MenuButton.new();
|
||||||
btn.as(gtk.Widget).setTooltipText(i18n._("Main Menu"));
|
btn.as(gtk.Widget).setTooltipText(i18n._("Main Menu"));
|
||||||
|
btn.as(gtk.Widget).setCanFocus(0);
|
||||||
btn.setIconName("open-menu-symbolic");
|
btn.setIconName("open-menu-symbolic");
|
||||||
btn.setPopover(self.titlebar_menu.asWidget());
|
btn.setPopover(self.titlebar_menu.asWidget());
|
||||||
_ = gobject.Object.signals.notify.connect(
|
_ = gobject.Object.signals.notify.connect(
|
||||||
@ -253,6 +254,7 @@ pub fn init(self: *Window, app: *App) !void {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
btn.setCanFocus(0);
|
||||||
btn.setFocusOnClick(0);
|
btn.setFocusOnClick(0);
|
||||||
self.headerbar.packEnd(btn);
|
self.headerbar.packEnd(btn);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user