aboutsummaryrefslogtreecommitdiffstats
path: root/sway/desktop/xwayland.c
diff options
context:
space:
mode:
authorLibravatar Drew DeVault <sir@cmpwn.com>2018-03-30 11:58:17 -0400
committerLibravatar Drew DeVault <sir@cmpwn.com>2018-03-30 13:49:34 -0400
commit49379dd0fc0758f89d7f4fa4fb5b08c7f4c26ae6 (patch)
treeb67a66382125811fde75e5c3dff37d7081860c78 /sway/desktop/xwayland.c
parentMerge pull request #1664 from swaywm/xwayland-add-to-focused (diff)
downloadsway-49379dd0fc0758f89d7f4fa4fb5b08c7f4c26ae6.tar.gz
sway-49379dd0fc0758f89d7f4fa4fb5b08c7f4c26ae6.tar.zst
sway-49379dd0fc0758f89d7f4fa4fb5b08c7f4c26ae6.zip
Fix workspace deletion edge cases
Diffstat (limited to 'sway/desktop/xwayland.c')
-rw-r--r--sway/desktop/xwayland.c20
1 files changed, 4 insertions, 16 deletions
diff --git a/sway/desktop/xwayland.c b/sway/desktop/xwayland.c
index 3e08b20e..357c8883 100644
--- a/sway/desktop/xwayland.c
+++ b/sway/desktop/xwayland.c
@@ -109,29 +109,17 @@ static void handle_destroy(struct wl_listener *listener, void *data) {
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 wl_list_remove(&sway_surface->view->unmanaged_view_link); 111 wl_list_remove(&sway_surface->view->unmanaged_view_link);
112 112 container_view_destroy(sway_surface->view->swayc);
113 struct sway_container *parent = container_view_destroy(sway_surface->view->swayc); 113 sway_surface->view->swayc = NULL;
114 if (parent) { 114 sway_surface->view->surface = NULL;
115 arrange_windows(parent, -1, -1);
116 }
117
118 free(sway_surface->view);
119 free(sway_surface);
120} 115}
121 116
122static void handle_unmap_notify(struct wl_listener *listener, void *data) { 117static void handle_unmap_notify(struct wl_listener *listener, void *data) {
123 struct sway_xwayland_surface *sway_surface = 118 struct sway_xwayland_surface *sway_surface =
124 wl_container_of(listener, sway_surface, unmap_notify); 119 wl_container_of(listener, sway_surface, unmap_notify);
125
126 wl_list_remove(&sway_surface->view->unmanaged_view_link); 120 wl_list_remove(&sway_surface->view->unmanaged_view_link);
127 wl_list_init(&sway_surface->view->unmanaged_view_link); 121 wl_list_init(&sway_surface->view->unmanaged_view_link);
128 122 container_view_destroy(sway_surface->view->swayc);
129 // take it out of the tree
130 struct sway_container *parent = container_view_destroy(sway_surface->view->swayc);
131 if (parent) {
132 arrange_windows(parent, -1, -1);
133 }
134
135 sway_surface->view->swayc = NULL; 123 sway_surface->view->swayc = NULL;
136 sway_surface->view->surface = NULL; 124 sway_surface->view->surface = NULL;
137} 125}