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.
This commit is contained in:
Florian Müllner 2021-08-28 00:10:00 +02:00
parent f1702d24e7
commit 3fa26861cd

View File

@ -5796,16 +5796,14 @@ gtk_window_activate_menubar (GtkWidget *widget,
GtkWidget *focus; GtkWidget *focus;
GtkWidget *first; 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); tmp_menubars = gtk_popover_menu_bar_get_viewable_menu_bars (window);
if (tmp_menubars == NULL) 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));; menubars = g_ptr_array_sized_new (g_list_length (tmp_menubars));;
for (l = tmp_menubars; l; l = l->next) for (l = tmp_menubars; l; l = l->next)