[gtk/wip/matthiasc/popup5: 167/187] wayland: recreate serverside resources on show



commit 0372b0e0642a48b6173a7d8432b04f1356437787
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon May 20 12:12:22 2019 +0000

    wayland: recreate serverside resources on show
    
    Without this, we run into a Wayland protocol
    error the second time we show a popup.

 gdk/wayland/gdksurface-wayland.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/gdk/wayland/gdksurface-wayland.c b/gdk/wayland/gdksurface-wayland.c
index 6d670697cb..03e51c16a4 100644
--- a/gdk/wayland/gdksurface-wayland.c
+++ b/gdk/wayland/gdksurface-wayland.c
@@ -2459,15 +2459,18 @@ gdk_wayland_surface_map (GdkSurface *surface)
   impl->mapped = TRUE;
 }
 
+static void gdk_wayland_surface_destroy_surface (GdkSurface *surface);
+
 static void
 gdk_wayland_surface_show (GdkSurface *surface,
                           gboolean    already_mapped)
 {
   GdkWaylandSurface *impl = GDK_WAYLAND_SURFACE (surface);
 
-  if (!impl->display_server.wl_surface)
-    gdk_wayland_surface_create_surface (surface);
+  if (impl->display_server.wl_surface)
+    gdk_wayland_surface_destroy_surface (surface);
 
+  gdk_wayland_surface_create_surface (surface);
   gdk_wayland_surface_map (surface);
 }
 


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