From ec43a1f72a552184176769f605c37013702b4843 Mon Sep 17 00:00:00 2001 From: Thomas Wood Date: Thu, 14 Feb 2013 14:44:58 +0000 Subject: [PATCH] wayland: look further through the hierarchy for the surface with the grab https://bugzilla.gnome.org/show_bug.cgi?id=693912 --- gdk/wayland/gdkwindow-wayland.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/gdk/wayland/gdkwindow-wayland.c b/gdk/wayland/gdkwindow-wayland.c index 15cef9f4a..920ead266 100644 --- a/gdk/wayland/gdkwindow-wayland.c +++ b/gdk/wayland/gdkwindow-wayland.c @@ -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 || -- 2.43.2