Commit c5a4bd05 authored by Carlos Garnacho's avatar Carlos Garnacho

GtkMenuShell: Store device on GTK+ device grab.

gtk_menu_shell_deactivate() needs to know the device to end the
GTK+ grab.
parent 404f4c5d
......@@ -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);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment