mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-25 22:25:58 +01:00
compositor: add wlr_surface.unmap_commit
This flag can be used to figure out whether a particular commit has unmapped the surface. Private state for now in case we find a better way to track this.
This commit is contained in:
parent
e1c2671725
commit
4d2e310122
2 changed files with 5 additions and 0 deletions
|
@ -211,6 +211,8 @@ struct wlr_surface {
|
||||||
int buffer_width, buffer_height;
|
int buffer_width, buffer_height;
|
||||||
} previous;
|
} previous;
|
||||||
|
|
||||||
|
bool unmap_commit;
|
||||||
|
|
||||||
bool opaque;
|
bool opaque;
|
||||||
bool has_buffer;
|
bool has_buffer;
|
||||||
|
|
||||||
|
|
|
@ -439,7 +439,10 @@ static void surface_commit_state(struct wlr_surface *surface,
|
||||||
bool invalid_buffer = next->committed & WLR_SURFACE_STATE_BUFFER;
|
bool invalid_buffer = next->committed & WLR_SURFACE_STATE_BUFFER;
|
||||||
|
|
||||||
if (invalid_buffer && next->buffer == NULL) {
|
if (invalid_buffer && next->buffer == NULL) {
|
||||||
|
surface->unmap_commit = surface->mapped;
|
||||||
wlr_surface_unmap(surface);
|
wlr_surface_unmap(surface);
|
||||||
|
} else {
|
||||||
|
surface->unmap_commit = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
surface_update_damage(&surface->buffer_damage, &surface->current, next);
|
surface_update_damage(&surface->buffer_damage, &surface->current, next);
|
||||||
|
|
Loading…
Reference in a new issue