[gtk+] broadway: Unsure we clear the grab on window hide



commit 9a79c3d643d7381e1755866bf7a9b6ffc2a06595
Author: Alexander Larsson <alexl redhat com>
Date:   Fri Apr 5 17:06:09 2013 +0200

    broadway: Unsure we clear the grab on window hide

 gdk/broadway/gdkdevice-broadway.c  |   23 +++++++++++++++++++++++
 gdk/broadway/gdkprivate-broadway.h |    2 ++
 gdk/broadway/gdkwindow-broadway.c  |    4 ++++
 3 files changed, 29 insertions(+), 0 deletions(-)
---
diff --git a/gdk/broadway/gdkdevice-broadway.c b/gdk/broadway/gdkdevice-broadway.c
index b87186e..f8dec23 100644
--- a/gdk/broadway/gdkdevice-broadway.c
+++ b/gdk/broadway/gdkdevice-broadway.c
@@ -212,6 +212,29 @@ gdk_broadway_device_query_state (GdkDevice        *device,
 }
 
 void
+_gdk_broadway_window_grab_check_unmap (GdkWindow *window,
+                                      gulong     serial)
+{
+  GdkDisplay *display = gdk_window_get_display (window);
+  GdkDeviceManager *device_manager;
+  GList *devices, *d;
+
+  device_manager = gdk_display_get_device_manager (display);
+
+  /* Get all devices */
+  devices = gdk_device_manager_list_devices (device_manager, GDK_DEVICE_TYPE_MASTER);
+  devices = g_list_concat (devices, gdk_device_manager_list_devices (device_manager, GDK_DEVICE_TYPE_SLAVE));
+  devices = g_list_concat (devices, gdk_device_manager_list_devices (device_manager, 
GDK_DEVICE_TYPE_FLOATING));
+
+  /* End all grabs on the newly hidden window */
+  for (d = devices; d; d = d->next)
+    _gdk_display_end_device_grab (display, d->data, serial, window, TRUE);
+
+  g_list_free (devices);
+}
+
+
+void
 _gdk_broadway_window_grab_check_destroy (GdkWindow *window)
 {
   GdkDisplay *display = gdk_window_get_display (window);
diff --git a/gdk/broadway/gdkprivate-broadway.h b/gdk/broadway/gdkprivate-broadway.h
index 8277c08..e611ca8 100644
--- a/gdk/broadway/gdkprivate-broadway.h
+++ b/gdk/broadway/gdkprivate-broadway.h
@@ -92,6 +92,8 @@ gboolean _gdk_broadway_moveresize_configure_done (GdkDisplay *display,
 
 void     _gdk_broadway_selection_window_destroyed (GdkWindow *window);
 void     _gdk_broadway_window_grab_check_destroy (GdkWindow *window);
+void     _gdk_broadway_window_grab_check_unmap (GdkWindow *window,
+                                               gulong     serial);
 
 void _gdk_keymap_keys_changed     (GdkDisplay      *display);
 gint _gdk_broadway_get_group_for_state (GdkDisplay      *display,
diff --git a/gdk/broadway/gdkwindow-broadway.c b/gdk/broadway/gdkwindow-broadway.c
index 3784b5a..7919d1c 100644
--- a/gdk/broadway/gdkwindow-broadway.c
+++ b/gdk/broadway/gdkwindow-broadway.c
@@ -437,6 +437,10 @@ gdk_window_broadway_hide (GdkWindow *window)
     _gdk_make_event (GDK_WINDOW (window), GDK_UNMAP, NULL, FALSE);
 
   broadway_display = GDK_BROADWAY_DISPLAY (gdk_window_get_display (window));
+
+  _gdk_broadway_window_grab_check_unmap (window,
+                                        _gdk_broadway_server_get_next_serial (broadway_display->server));
+
   if (_gdk_broadway_server_window_hide (broadway_display->server, impl->id))
     queue_flush (window);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]