mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-10-31 22:25:21 -04:00
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.
This commit is contained in:
parent
b24b50ec0c
commit
668b2740ff
6 changed files with 10 additions and 8 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue