aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKirill Primak <vyivel@eclair.cafe>2023-10-07 13:17:34 +0300
committerSimon Ser <contact@emersion.fr>2023-10-26 14:57:10 +0000
commit4d2e31012207a56b3345039ecd2637fe46654993 (patch)
tree634c9d506cc7728af4dd1a1352639574cf543dd8
parente1c267172556a3b5b120d3469b59cb91af355a14 (diff)
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.
-rw-r--r--include/wlr/types/wlr_compositor.h2
-rw-r--r--types/wlr_compositor.c3
2 files changed, 5 insertions, 0 deletions
diff --git a/include/wlr/types/wlr_compositor.h b/include/wlr/types/wlr_compositor.h
index d67ce1c3..53e663fd 100644
--- a/include/wlr/types/wlr_compositor.h
+++ b/include/wlr/types/wlr_compositor.h
@@ -211,6 +211,8 @@ struct wlr_surface {
int buffer_width, buffer_height;
} previous;
+ bool unmap_commit;
+
bool opaque;
bool has_buffer;
diff --git a/types/wlr_compositor.c b/types/wlr_compositor.c
index 15cb5f82..70c1f9cc 100644
--- a/types/wlr_compositor.c
+++ b/types/wlr_compositor.c
@@ -439,7 +439,10 @@ static void surface_commit_state(struct wlr_surface *surface,
bool invalid_buffer = next->committed & WLR_SURFACE_STATE_BUFFER;
if (invalid_buffer && next->buffer == NULL) {
+ surface->unmap_commit = surface->mapped;
wlr_surface_unmap(surface);
+ } else {
+ surface->unmap_commit = false;
}
surface_update_damage(&surface->buffer_damage, &surface->current, next);