From 2d460502812093b47f43295cf21636198e44edbb Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Fri, 30 Mar 2018 00:46:40 -0400 Subject: [PATCH] Fix crash when override redirect views close --- sway/desktop/xwayland.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sway/desktop/xwayland.c b/sway/desktop/xwayland.c index fd0bcaca..38ee4656 100644 --- a/sway/desktop/xwayland.c +++ b/sway/desktop/xwayland.c @@ -108,10 +108,9 @@ static void handle_destroy(struct wl_listener *listener, void *data) { wl_list_remove(&sway_surface->commit.link); wl_list_remove(&sway_surface->destroy.link); wl_list_remove(&sway_surface->request_configure.link); - if (xsurface->override_redirect) { - if (xsurface->mapped) { - wl_list_remove(&sway_surface->view->unmanaged_view_link); - } + if (xsurface->override_redirect && xsurface->mapped) { + wl_list_remove(&sway_surface->view->unmanaged_view_link); + wl_list_init(&sway_surface->view->unmanaged_view_link); } struct sway_container *parent = container_view_destroy(sway_surface->view->swayc); @@ -127,8 +126,9 @@ static void handle_unmap_notify(struct wl_listener *listener, void *data) { struct sway_xwayland_surface *sway_surface = wl_container_of(listener, sway_surface, unmap_notify); struct wlr_xwayland_surface *xsurface = data; - if (xsurface->override_redirect) { + if (xsurface->override_redirect && xsurface->mapped) { wl_list_remove(&sway_surface->view->unmanaged_view_link); + wl_list_init(&sway_surface->view->unmanaged_view_link); } // take it out of the tree