wayland: Update grab serial when ungrabbing keyboards
authorCarlos Garnacho <carlosg@gnome.org>
Wed, 24 Jun 2015 13:41:23 +0000 (15:41 +0200)
committerCarlos Garnacho <carlosg@gnome.org>
Wed, 24 Jun 2015 14:42:07 +0000 (16:42 +0200)
This was being done so only on pointers. Internally, a GdkDeviceGrabInfo
is kept for each of the master pointer/keyboard, failing to do this for
keyboards results in a stuck keyboard grab.

https://bugzilla.gnome.org/show_bug.cgi?id=748892

gdk/wayland/gdkdevice-wayland.c

index 9ef8968b7529ecd39a6e85f93abf307e88bed740..45ba21b6dac16024feecd5d0f07aaa0116b5dfd9 100644 (file)
@@ -415,6 +415,11 @@ gdk_wayland_device_ungrab (GdkDevice *device,
 
   display = gdk_device_get_display (device);
 
+  grab = _gdk_display_get_last_device_grab (display, device);
+
+  if (grab)
+    grab->serial_end = grab->serial_start;
+
   if (gdk_device_get_source (device) == GDK_SOURCE_KEYBOARD)
     {
       /* Device is a keyboard */
@@ -422,11 +427,6 @@ gdk_wayland_device_ungrab (GdkDevice *device,
   else
     {
       /* Device is a pointer */
-      grab = _gdk_display_get_last_device_grab (display, device);
-
-      if (grab)
-        grab->serial_end = grab->serial_start;
-
       g_clear_object (&wayland_device->grab_cursor);
       gdk_wayland_device_update_window_cursor (wayland_device);