GtkMenuShell: Store device on GTK+ device grab.

gtk_menu_shell_deactivate() needs to know the device to end the
GTK+ grab.
This commit is contained in:
Carlos Garnacho 2010-06-16 01:13:42 +02:00
parent 404f4c5d40
commit c5a4bd0578

View File

@ -550,9 +550,13 @@ _gtk_menu_shell_activate (GtkMenuShell *menu_shell)
{ {
if (!menu_shell->active) if (!menu_shell->active)
{ {
gtk_device_grab_add (GTK_WIDGET (menu_shell), GdkDevice *device;
gtk_get_current_event_device (),
TRUE); device = gtk_get_current_event_device ();
_gtk_menu_shell_set_grab_device (menu_shell, device);
gtk_device_grab_add (GTK_WIDGET (menu_shell), device, TRUE);
menu_shell->have_grab = TRUE; menu_shell->have_grab = TRUE;
menu_shell->active = TRUE; menu_shell->active = TRUE;
} }
@ -1105,10 +1109,10 @@ gtk_real_menu_shell_deactivate (GtkMenuShell *menu_shell)
gdk_device_ungrab (keyboard, GDK_CURRENT_TIME); gdk_device_ungrab (keyboard, GDK_CURRENT_TIME);
menu_shell->have_xgrab = FALSE; menu_shell->have_xgrab = FALSE;
_gtk_menu_shell_set_grab_device (menu_shell, NULL);
} }
menu_shell->keyboard_mode = FALSE; menu_shell->keyboard_mode = FALSE;
_gtk_menu_shell_set_grab_device (menu_shell, NULL);
_gtk_menu_shell_update_mnemonics (menu_shell); _gtk_menu_shell_update_mnemonics (menu_shell);
} }