[gtk/wip/matthiasc/context-menu] wayland: Fix the popover race workaround



commit e1b8e155c5db41af3a8310a9e5d9a0fcbe576db7
Author: Matthias Clasen <mclasen redhat com>
Date:   Wed Jun 12 19:07:29 2019 +0000

    wayland: Fix the popover race workaround
    
    The Wayland backend has a hack to work around
    a race with popover mapping: If the surface size
    changes before the initial configure, we hide and
    show the surface. Unfortunately, the code was doing
    this in a way that is externally observable (by
    listening for surface state changes), and popovers
    were observing it and hiding themselves in response.
    
    Avoid this by not going through the GDK frontend
    code for this.

 gdk/wayland/gdksurface-wayland.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/gdk/wayland/gdksurface-wayland.c b/gdk/wayland/gdksurface-wayland.c
index 658b3569f6..1bc06568c7 100644
--- a/gdk/wayland/gdksurface-wayland.c
+++ b/gdk/wayland/gdksurface-wayland.c
@@ -696,6 +696,10 @@ is_realized_popup (GdkSurface *surface)
           impl->display_server.zxdg_popup_v6);
 }
 
+static void gdk_wayland_surface_show (GdkSurface *surface,
+                                      gboolean    already_mapped);
+static void gdk_wayland_surface_hide (GdkSurface *surface);
+
 static void
 gdk_wayland_surface_maybe_configure (GdkSurface *surface,
                                      int         width,
@@ -721,12 +725,12 @@ gdk_wayland_surface_maybe_configure (GdkSurface *surface,
   is_visible = gdk_surface_is_visible (surface);
 
   if (is_xdg_popup && is_visible && !impl->initial_configure_received)
-    gdk_surface_hide (surface);
+    gdk_wayland_surface_hide (surface);
 
   gdk_wayland_surface_configure (surface, width, height, scale);
 
   if (is_xdg_popup && is_visible && !impl->initial_configure_received)
-    gdk_surface_show (surface);
+    gdk_wayland_surface_show (surface, FALSE);
 }
 
 static void


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