From c5a4bd0578f6b0f612e2f9866c645fdecdddf720 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Wed, 16 Jun 2010 01:13:42 +0200 Subject: [PATCH] GtkMenuShell: Store device on GTK+ device grab. gtk_menu_shell_deactivate() needs to know the device to end the GTK+ grab. --- gtk/gtkmenushell.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/gtk/gtkmenushell.c b/gtk/gtkmenushell.c index f4cdc46de7..7c62a3dd29 100644 --- a/gtk/gtkmenushell.c +++ b/gtk/gtkmenushell.c @@ -550,9 +550,13 @@ _gtk_menu_shell_activate (GtkMenuShell *menu_shell) { if (!menu_shell->active) { - gtk_device_grab_add (GTK_WIDGET (menu_shell), - gtk_get_current_event_device (), - TRUE); + GdkDevice *device; + + 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->active = TRUE; } @@ -1105,10 +1109,10 @@ gtk_real_menu_shell_deactivate (GtkMenuShell *menu_shell) gdk_device_ungrab (keyboard, GDK_CURRENT_TIME); menu_shell->have_xgrab = FALSE; - _gtk_menu_shell_set_grab_device (menu_shell, NULL); } menu_shell->keyboard_mode = FALSE; + _gtk_menu_shell_set_grab_device (menu_shell, NULL); _gtk_menu_shell_update_mnemonics (menu_shell); }