[gtk+] wayland: Ensure modal hint gets set on map



commit bd3b496586ee6dc295a6b5dfe00aa1ea65b6291d
Author: Rui Matos <tiagomatos gmail com>
Date:   Sat Aug 1 17:03:49 2015 +0200

    wayland: Ensure modal hint gets set on map
    
    We need to be mapped to have a gtk_surface and thus be able to do
    requests on it so we need to save the modal hint and apply it when we
    get mapped so that code that sets the hint before showing a window
    doesn't get ignored.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=753138

 gdk/wayland/gdkwindow-wayland.c |   16 +++++++++++++---
 1 files changed, 13 insertions(+), 3 deletions(-)
---
diff --git a/gdk/wayland/gdkwindow-wayland.c b/gdk/wayland/gdkwindow-wayland.c
index fd02480..c700a56 100644
--- a/gdk/wayland/gdkwindow-wayland.c
+++ b/gdk/wayland/gdkwindow-wayland.c
@@ -159,6 +159,7 @@ static void gdk_wayland_window_configure (GdkWindow *window,
                                           int        scale);
 
 static void maybe_set_gtk_surface_dbus_properties (GdkWindow *window);
+static void maybe_set_gtk_surface_modal (GdkWindow *window);
 
 static void gdk_window_request_transient_parent_commit (GdkWindow *window);
 
@@ -1026,6 +1027,7 @@ gdk_wayland_window_create_xdg_surface (GdkWindow *window)
   xdg_surface_set_app_id (impl->xdg_surface, app_id);
 
   maybe_set_gtk_surface_dbus_properties (window);
+  maybe_set_gtk_surface_modal (window);
 }
 
 static void
@@ -1699,8 +1701,7 @@ gdk_wayland_window_init_gtk_surface (GdkWindow *window)
 }
 
 static void
-gdk_wayland_window_set_modal_hint (GdkWindow *window,
-                                   gboolean   modal)
+maybe_set_gtk_surface_modal (GdkWindow *window)
 {
   GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
 
@@ -1708,10 +1709,19 @@ gdk_wayland_window_set_modal_hint (GdkWindow *window,
   if (impl->gtk_surface == NULL)
     return;
 
-  if (modal)
+  if (window->modal_hint)
     gtk_surface_set_modal (impl->gtk_surface);
   else
     gtk_surface_unset_modal (impl->gtk_surface);
+
+}
+
+static void
+gdk_wayland_window_set_modal_hint (GdkWindow *window,
+                                   gboolean   modal)
+{
+  window->modal_hint = modal;
+  maybe_set_gtk_surface_modal (window);
 }
 
 static void



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