]> git.mdlowis.com Git - proto/labwc.git/commitdiff
xwayland: Hide unmanaged nodes on unmap()
authorJohn Lindgren <john@jlindgren.net>
Thu, 27 Oct 2022 17:53:50 +0000 (13:53 -0400)
committerJohn Lindgren <john@jlindgren.net>
Thu, 27 Oct 2022 19:03:13 +0000 (15:03 -0400)
Since xwayland commit 9e4b7948df5a9a67632bb606150ec171b5519672
there is a one-second delay between XWayland surfaces being
unmapped and destroyed.  This revealed that we were not actually
handling the unmap() signal correctly for unmanaged surfaces.

src/xwayland-unmanaged.c

index c408858d58966e57e3648d014e31b77fd6d86122..5979ba20ebda65b8964b782307a5460da82468e8 100644 (file)
@@ -1,4 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0-only
+#include <assert.h>
 #include "common/list.h"
 #include "common/mem.h"
 #include "labwc.h"
@@ -35,6 +36,7 @@ unmanaged_handle_map(struct wl_listener *listener, void *data)
        struct xwayland_unmanaged *unmanaged =
                wl_container_of(listener, unmanaged, map);
        struct wlr_xwayland_surface *xsurface = unmanaged->xwayland_surface;
+       assert(!unmanaged->node);
 
        /* Stack new surface on top */
        wlr_xwayland_surface_restack(xsurface, NULL, XCB_STACK_MODE_ABOVE);
@@ -94,9 +96,11 @@ unmanaged_handle_unmap(struct wl_listener *listener, void *data)
                wl_container_of(listener, unmanaged, unmap);
        struct wlr_xwayland_surface *xsurface = unmanaged->xwayland_surface;
        struct seat *seat = &unmanaged->server->seat;
+       assert(unmanaged->node);
 
        wl_list_remove(&unmanaged->link);
        wl_list_remove(&unmanaged->set_geometry.link);
+       wlr_scene_node_set_enabled(unmanaged->node, false);
 
        /*
         * Mark the node as gone so a racing configure event