From 5fb18a7016fcb875f3d73ca49931b8f3c40a7b37 Mon Sep 17 00:00:00 2001 From: John Lindgren Date: Thu, 27 Oct 2022 13:53:50 -0400 Subject: [PATCH] xwayland: Hide unmanaged nodes on unmap() 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 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/xwayland-unmanaged.c b/src/xwayland-unmanaged.c index c408858d..5979ba20 100644 --- a/src/xwayland-unmanaged.c +++ b/src/xwayland-unmanaged.c @@ -1,4 +1,5 @@ // SPDX-License-Identifier: GPL-2.0-only +#include #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