aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar emersion <contact@emersion.fr>2018-04-05 17:11:46 -0400
committerLibravatar emersion <contact@emersion.fr>2018-04-05 17:11:46 -0400
commita528aea2ee87a211edd3e6df83f2d408656430ab (patch)
tree9f042a041131ae16c408e8fed36f13d7fcef634a
parentFix xwayland unmanaged surfaces (diff)
downloadsway-a528aea2ee87a211edd3e6df83f2d408656430ab.tar.gz
sway-a528aea2ee87a211edd3e6df83f2d408656430ab.tar.zst
sway-a528aea2ee87a211edd3e6df83f2d408656430ab.zip
Make xwayland surface destroy more foolproof
-rw-r--r--sway/desktop/xwayland.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/sway/desktop/xwayland.c b/sway/desktop/xwayland.c
index 543c914e..0a70b680 100644
--- a/sway/desktop/xwayland.c
+++ b/sway/desktop/xwayland.c
@@ -176,12 +176,6 @@ static void handle_commit(struct wl_listener *listener, void *data) {
176 view_damage_from(view); 176 view_damage_from(view);
177} 177}
178 178
179static void handle_destroy(struct wl_listener *listener, void *data) {
180 struct sway_xwayland_view *xwayland_view =
181 wl_container_of(listener, xwayland_view, destroy);
182 view_destroy(&xwayland_view->view);
183}
184
185static void handle_unmap(struct wl_listener *listener, void *data) { 179static void handle_unmap(struct wl_listener *listener, void *data) {
186 struct sway_xwayland_view *xwayland_view = 180 struct sway_xwayland_view *xwayland_view =
187 wl_container_of(listener, xwayland_view, unmap); 181 wl_container_of(listener, xwayland_view, unmap);
@@ -205,6 +199,17 @@ static void handle_map(struct wl_listener *listener, void *data) {
205 view_map(view, xsurface->surface); 199 view_map(view, xsurface->surface);
206} 200}
207 201
202static void handle_destroy(struct wl_listener *listener, void *data) {
203 struct sway_xwayland_view *xwayland_view =
204 wl_container_of(listener, xwayland_view, destroy);
205 struct sway_view *view = &xwayland_view->view;
206 struct wlr_xwayland_surface *xsurface = view->wlr_xwayland_surface;
207 if (xsurface->mapped) {
208 handle_unmap(&xwayland_view->unmap, xsurface);
209 }
210 view_destroy(&xwayland_view->view);
211}
212
208static void handle_request_configure(struct wl_listener *listener, void *data) { 213static void handle_request_configure(struct wl_listener *listener, void *data) {
209 struct sway_xwayland_view *xwayland_view = 214 struct sway_xwayland_view *xwayland_view =
210 wl_container_of(listener, xwayland_view, request_configure); 215 wl_container_of(listener, xwayland_view, request_configure);