From 527a99e59871f278a2e5ee4b14233f2681fb5362 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nelson=20Ben=C3=ADtez=20Le=C3=B3n?= Date: Tue, 31 Mar 2020 20:43:14 -0400 Subject: [PATCH] GtkMenuButton: disable focus-on-click As general rule, all buttons that launch a menu should not grab focus on click, because otherwise when the menu is closed the focus goes back to the button instead of the previously focused widget, which is the one the user was interacting with. GtkScaleButton and GtkVolumeButton set focus-on-click to FALSE for this same reason. Fixes #2557 --- gtk/gtkmenubutton.c | 1 + 1 file changed, 1 insertion(+) diff --git a/gtk/gtkmenubutton.c b/gtk/gtkmenubutton.c index 8eb18fc4c85..56b687f846a 100644 --- a/gtk/gtkmenubutton.c +++ b/gtk/gtkmenubutton.c @@ -621,6 +621,7 @@ gtk_menu_button_init (GtkMenuButton *menu_button) add_arrow (menu_button); + gtk_widget_set_focus_on_click (GTK_WIDGET (menu_button), FALSE); gtk_widget_set_sensitive (GTK_WIDGET (menu_button), FALSE); context = gtk_widget_get_style_context (GTK_WIDGET (menu_button)); -- GitLab