diff options
author | Kenny Levinsen <kl@kl.wtf> | 2022-08-02 18:26:46 +0200 |
---|---|---|
committer | Kenny Levinsen <kl@kl.wtf> | 2022-08-06 00:19:38 +0200 |
commit | 668b2740ff0fed82f8e486b2abdb536cfe8c2da9 (patch) | |
tree | f8a923c775f5c707c49b917701c7fd8fa0bcd1ce /xwayland/xwm.c | |
parent | b24b50ec0c1c54a14acf34df2c95b37043d15b49 (diff) |
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.
Diffstat (limited to 'xwayland/xwm.c')
-rw-r--r-- | xwayland/xwm.c | 4 |
1 files changed, 2 insertions, 2 deletions
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); } } |