Fix keyboard activation of menu buttons

Keyboard activation relies on the menu not being visible,
so ensure that it isn't when the menu is attached.

Problem tracked down by Vincent Le Garrec,
https://bugzilla.gnome.org/show_bug.cgi?id=688738
This commit is contained in:
Matthias Clasen
2013-08-18 22:22:22 -04:00
parent 624ec0fb7d
commit dc4f555d25

View File

@ -655,10 +655,7 @@ _gtk_menu_button_set_popup_with_func (GtkMenuButton *menu_button
{
if (gtk_widget_get_visible (GTK_WIDGET (priv->popup)))
gtk_menu_shell_deactivate (GTK_MENU_SHELL (priv->popup));
}
if (priv->popup)
{
g_signal_handlers_disconnect_by_func (priv->popup,
menu_deactivate_cb,
menu_button);
@ -672,6 +669,7 @@ _gtk_menu_button_set_popup_with_func (GtkMenuButton *menu_button
gtk_menu_attach_to_widget (GTK_MENU (priv->popup), GTK_WIDGET (menu_button),
menu_detacher);
gtk_widget_set_visible (priv->popup, FALSE);
gtk_widget_set_sensitive (GTK_WIDGET (menu_button), TRUE);
g_signal_connect (priv->popup, "deactivate",