]> Pileus Git - ~andy/gtk/commitdiff
wayland: look further through the hierarchy for the surface with the grab
authorThomas Wood <thomas.wood@intel.com>
Thu, 14 Feb 2013 14:44:58 +0000 (14:44 +0000)
committerCosimo Cecchi <cosimoc@gnome.org>
Tue, 19 Feb 2013 00:38:21 +0000 (19:38 -0500)
https://bugzilla.gnome.org/show_bug.cgi?id=693912

gdk/wayland/gdkwindow-wayland.c

index 15cef9f4a5306ba152183c311d75c2a18b559c18..920ead2663f2d8070029d9cece0db848686bf5fb 100644 (file)
@@ -569,6 +569,7 @@ gdk_wayland_window_map (GdkWindow *window)
       if (impl->transient_for)
         {
           struct wl_seat *grab_input_seat = NULL;
+          GdkWindowImplWayland *tmp_impl;
 
           parent = GDK_WINDOW_IMPL_WAYLAND (impl->transient_for->impl);
 
@@ -576,11 +577,18 @@ gdk_wayland_window_map (GdkWindow *window)
            * the popup window setup - so this relies on GTK+ taking the
            * grab before showing the popup window.
            */
-          if (impl->grab_input_seat)
-            grab_input_seat = impl->grab_input_seat;
+          grab_input_seat = impl->grab_input_seat;
 
-          if (!grab_input_seat)
-            grab_input_seat = parent->grab_input_seat;
+          tmp_impl = parent;
+          while (!grab_input_seat)
+            {
+              grab_input_seat = tmp_impl->grab_input_seat;
+
+              if (tmp_impl->transient_for)
+                tmp_impl = GDK_WINDOW_IMPL_WAYLAND (tmp_impl->transient_for->impl);
+              else
+                break;
+            }
 
           if (grab_input_seat &&
               (impl->hint == GDK_WINDOW_TYPE_HINT_POPUP_MENU ||