From 80dbb9ba71bd7d035523010db9bce149c8dd7e02 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Wed, 24 Mar 2021 15:52:49 +0100 Subject: subsurface: immediately unlock cached state in set_desync set_desync takes effect immediately without waiting for the next wl_surface.commit request. --- types/wlr_surface.c | 12 +++++++----- 1 file 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); } } -- cgit v1.2.3