From 668b2740ff0fed82f8e486b2abdb536cfe8c2da9 Mon Sep 17 00:00:00 2001 From: Kenny Levinsen Date: Tue, 2 Aug 2022 18:26:46 +0200 Subject: Set mapped before firing map/unmap events This allows whatever the user calls from the signal handlers to react to observe the new state rather than the old, e.g. that a surface is no longer mapped in the unmap handler. --- xwayland/xwm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'xwayland/xwm.c') diff --git a/xwayland/xwm.c b/xwayland/xwm.c index b398f2ab..1bacd1ce 100644 --- a/xwayland/xwm.c +++ b/xwayland/xwm.c @@ -836,8 +836,8 @@ static void xwayland_surface_role_commit(struct wlr_surface *wlr_surface) { } if (!surface->mapped && wlr_surface_has_buffer(surface->surface)) { - wlr_signal_emit_safe(&surface->events.map, surface); surface->mapped = true; + wlr_signal_emit_safe(&surface->events.map, surface); xwm_set_net_client_list(surface->xwm); } } @@ -853,8 +853,8 @@ static void xwayland_surface_role_precommit(struct wlr_surface *wlr_surface, if (state->committed & WLR_SURFACE_STATE_BUFFER && state->buffer == NULL) { // This is a NULL commit if (surface->mapped) { - wlr_signal_emit_safe(&surface->events.unmap, surface); surface->mapped = false; + wlr_signal_emit_safe(&surface->events.unmap, surface); xwm_set_net_client_list(surface->xwm); } } -- cgit v1.2.3