aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Drew DeVault <sir@cmpwn.com>2018-03-30 00:46:40 -0400
committerLibravatar Drew DeVault <sir@cmpwn.com>2018-03-30 00:46:40 -0400
commit2d460502812093b47f43295cf21636198e44edbb (patch)
tree90d43a5973bd9f9d90a7e159bb2de1b03550831d
parentFinish porting over workspace_next_name (diff)
downloadsway-2d460502812093b47f43295cf21636198e44edbb.tar.gz
sway-2d460502812093b47f43295cf21636198e44edbb.tar.zst
sway-2d460502812093b47f43295cf21636198e44edbb.zip
Fix crash when override redirect views close
-rw-r--r--sway/desktop/xwayland.c10
1 files 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) {
108 wl_list_remove(&sway_surface->commit.link); 108 wl_list_remove(&sway_surface->commit.link);
109 wl_list_remove(&sway_surface->destroy.link); 109 wl_list_remove(&sway_surface->destroy.link);
110 wl_list_remove(&sway_surface->request_configure.link); 110 wl_list_remove(&sway_surface->request_configure.link);
111 if (xsurface->override_redirect) { 111 if (xsurface->override_redirect && xsurface->mapped) {
112 if (xsurface->mapped) { 112 wl_list_remove(&sway_surface->view->unmanaged_view_link);
113 wl_list_remove(&sway_surface->view->unmanaged_view_link); 113 wl_list_init(&sway_surface->view->unmanaged_view_link);
114 }
115 } 114 }
116 115
117 struct sway_container *parent = container_view_destroy(sway_surface->view->swayc); 116 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) {
127 struct sway_xwayland_surface *sway_surface = 126 struct sway_xwayland_surface *sway_surface =
128 wl_container_of(listener, sway_surface, unmap_notify); 127 wl_container_of(listener, sway_surface, unmap_notify);
129 struct wlr_xwayland_surface *xsurface = data; 128 struct wlr_xwayland_surface *xsurface = data;
130 if (xsurface->override_redirect) { 129 if (xsurface->override_redirect && xsurface->mapped) {
131 wl_list_remove(&sway_surface->view->unmanaged_view_link); 130 wl_list_remove(&sway_surface->view->unmanaged_view_link);
131 wl_list_init(&sway_surface->view->unmanaged_view_link);
132 } 132 }
133 133
134 // take it out of the tree 134 // take it out of the tree