From 8b07a4d05559698d3d88e227b2bb97f3fc9c4ca8 Mon Sep 17 00:00:00 2001 From: emersion Date: Fri, 6 Apr 2018 14:13:52 -0400 Subject: [PATCH] Emit xwayland unmap signal before unmapping This allows compositors to access the surface being unmapped. This is also more consistent with the destroy signal. --- xwayland/xwm.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/xwayland/xwm.c b/xwayland/xwm.c index c2b9bd11..886fe251 100644 --- a/xwayland/xwm.c +++ b/xwayland/xwm.c @@ -743,6 +743,11 @@ static void xwm_handle_unmap_notify(struct wlr_xwm *xwm, return; } + if (xsurface->mapped) { + xsurface->mapped = false; + wlr_signal_emit_safe(&xsurface->events.unmap, xsurface); + } + if (xsurface->surface_id) { // Make sure we're not on the unpaired surface list or we // could be assigned a surface during surface creation that @@ -757,11 +762,6 @@ static void xwm_handle_unmap_notify(struct wlr_xwm *xwm, } xsurface->surface = NULL; - if (xsurface->mapped) { - xsurface->mapped = false; - wlr_signal_emit_safe(&xsurface->events.unmap, xsurface); - } - xsurface_set_wm_state(xsurface, ICCCM_WITHDRAWN_STATE); }