From 4d2e31012207a56b3345039ecd2637fe46654993 Mon Sep 17 00:00:00 2001 From: Kirill Primak Date: Sat, 7 Oct 2023 13:17:34 +0300 Subject: 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. --- include/wlr/types/wlr_compositor.h | 2 ++ types/wlr_compositor.c | 3 +++ 2 files changed, 5 insertions(+) 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); -- cgit v1.2.3