GtkMenuShell: always 'activate' menu shells

Failing to do so can leave us with a stuck grab in some cases.
https://bugzilla.gnome.org/show_bug.cgi?id=554057
This commit is contained in:
Matthias Clasen 2011-04-13 13:28:46 -04:00
parent f771a641e2
commit 5f55c42047
3 changed files with 2 additions and 3 deletions

View File

@ -686,7 +686,6 @@ window_key_press_handler (GtkWidget *widget,
GtkMenuShell *menu_shell = GTK_MENU_SHELL (menubars->data);
_gtk_menu_shell_set_keyboard_mode (menu_shell, TRUE);
_gtk_menu_shell_activate (menu_shell);
gtk_menu_shell_select_first (menu_shell, FALSE);
g_list_free (menubars);

View File

@ -1190,7 +1190,6 @@ gtk_real_menu_shell_deactivate (GtkMenuShell *menu_shell)
if (priv->active)
{
priv->button = 0;
priv->active = FALSE;
priv->activate_time = 0;
@ -1313,6 +1312,8 @@ gtk_menu_shell_real_select_item (GtkMenuShell *menu_shell,
return;
}
_gtk_menu_shell_activate (menu_shell);
priv->active_menu_item = menu_item;
if (pack_dir == GTK_PACK_DIRECTION_TTB || pack_dir == GTK_PACK_DIRECTION_BTT)
_gtk_menu_item_set_placement (GTK_MENU_ITEM (priv->active_menu_item),

View File

@ -58,7 +58,6 @@ struct _GtkMenuShellPrivate
void _gtk_menu_shell_select_last (GtkMenuShell *menu_shell,
gboolean search_sensitive);
void _gtk_menu_shell_activate (GtkMenuShell *menu_shell);
gint _gtk_menu_shell_get_popup_delay (GtkMenuShell *menu_shell);
void _gtk_menu_shell_set_grab_device (GtkMenuShell *menu_shell,
GdkDevice *device);