summaryrefslogtreecommitdiff
path: root/gdk
diff options
context:
space:
mode:
authorRob Bradford <rob@linux.intel.com>2012-07-18 16:16:56 +0100
committerRob Bradford <rob@linux.intel.com>2012-07-18 16:16:56 +0100
commit7c51d67e7c6ce321616a442e30e29e2d0f731b50 (patch)
treeba476bfcbd28a467e352e9524efe0f5efa1d2564 /gdk
parent8a39d2269e9ab7354cdb38ca6255165e641ca9bd (diff)
downloadgtk+-7c51d67e7c6ce321616a442e30e29e2d0f731b50.tar.gz
wayland: Fallback to setting transient windows if no seat available
If we don't have a wl_seat - because a grab hasn't been initialised by GTK+ then fallback to making the shell surface transient to the parent rather than a popup surface.
Diffstat (limited to 'gdk')
-rw-r--r--gdk/wayland/gdkwindow-wayland.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/gdk/wayland/gdkwindow-wayland.c b/gdk/wayland/gdkwindow-wayland.c
index f2b7bf3cb1..fad879eafd 100644
--- a/gdk/wayland/gdkwindow-wayland.c
+++ b/gdk/wayland/gdkwindow-wayland.c
@@ -633,23 +633,25 @@ gdk_wayland_window_map (GdkWindow *window)
{
if (impl->transient_for)
{
+ struct wl_seat *grab_input_seat = NULL;
+
parent = GDK_WINDOW_IMPL_WAYLAND (impl->transient_for->impl);
- if (impl->hint == GDK_WINDOW_TYPE_HINT_POPUP_MENU ||
- impl->hint == GDK_WINDOW_TYPE_HINT_DROPDOWN_MENU ||
- impl->hint == GDK_WINDOW_TYPE_HINT_COMBO)
- {
- struct wl_seat *grab_input_seat = NULL;
+ /* Use the device that was used for the grab as the device for
+ * 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;
- /* Use the device that was used for the grab as the device for
- * 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;
+ if (!grab_input_seat)
+ grab_input_seat = parent->grab_input_seat;
- if (!grab_input_seat)
- grab_input_seat = parent->grab_input_seat;
+ if (grab_input_seat &&
+ (impl->hint == GDK_WINDOW_TYPE_HINT_POPUP_MENU ||
+ impl->hint == GDK_WINDOW_TYPE_HINT_DROPDOWN_MENU ||
+ impl->hint == GDK_WINDOW_TYPE_HINT_COMBO))
+ {
wl_shell_surface_set_popup (impl->shell_surface,
grab_input_seat,