aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2021-03-24 15:52:49 +0100
committerSimon Ser <contact@emersion.fr>2021-03-25 19:34:47 +0100
commit80dbb9ba71bd7d035523010db9bce149c8dd7e02 (patch)
tree7dfe1043aed43c3284e6463c16726f5dc015284f
parent8ecc557ab0770b2a890ff956c27ea9f5877873f3 (diff)
subsurface: immediately unlock cached state in set_desync
set_desync takes effect immediately without waiting for the next wl_surface.commit request.
-rw-r--r--types/wlr_surface.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/types/wlr_surface.c b/types/wlr_surface.c
index 561f45e3..a472b844 100644
--- a/types/wlr_surface.c
+++ b/types/wlr_surface.c
@@ -525,10 +525,6 @@ static void subsurface_commit(struct wlr_subsurface *subsurface) {
}
subsurface->has_cache = true;
subsurface->cached_seq = wlr_surface_lock_pending(surface);
- } else if (subsurface->has_cache) {
- wlr_surface_unlock_cached(surface, subsurface->cached_seq);
- subsurface->has_cache = false;
- subsurface->cached_seq = 0;
}
}
@@ -964,7 +960,13 @@ static void subsurface_handle_set_desync(struct wl_client *client,
subsurface->synchronized = false;
if (!subsurface_is_synchronized(subsurface)) {
- // TODO: do a synchronized commit to flush the cache
+ if (subsurface->has_cache) {
+ wlr_surface_unlock_cached(subsurface->surface,
+ subsurface->cached_seq);
+ subsurface->has_cache = false;
+ subsurface->cached_seq = 0;
+ }
+
subsurface_parent_commit(subsurface, true);
}
}