From 3fa26861cd513fbbf8610d64c8d593f757973066 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Sat, 28 Aug 2021 00:10:00 +0200 Subject: [PATCH] window: Prefer menu bars when handling F10 Focusing the first widget in the titlebar is a good fallback, but a "real" menubar or :primary menu button should take precedence. --- gtk/gtkwindow.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c index 57f2484d44..44cf033d2a 100644 --- a/gtk/gtkwindow.c +++ b/gtk/gtkwindow.c @@ -5796,16 +5796,14 @@ gtk_window_activate_menubar (GtkWidget *widget, GtkWidget *focus; GtkWidget *first; - focus = gtk_window_get_focus (window); - - if (priv->title_box != NULL && - (focus == NULL || !gtk_widget_is_ancestor (focus, priv->title_box)) && - gtk_widget_child_focus (priv->title_box, GTK_DIR_TAB_FORWARD)) - return TRUE; - tmp_menubars = gtk_popover_menu_bar_get_viewable_menu_bars (window); if (tmp_menubars == NULL) - return FALSE; + { + focus = gtk_window_get_focus (window); + return priv->title_box != NULL && + (focus == NULL || !gtk_widget_is_ancestor (focus, priv->title_box)) && + gtk_widget_child_focus (priv->title_box, GTK_DIR_TAB_FORWARD); + } menubars = g_ptr_array_sized_new (g_list_length (tmp_menubars));; for (l = tmp_menubars; l; l = l->next)