subsurface: immediately unlock cached state in set_desync

set_desync takes effect immediately without waiting for the next
wl_surface.commit request.
This commit is contained in:
Simon Ser 2021-03-24 15:52:49 +01:00
parent 8ecc557ab0
commit 80dbb9ba71

View file

@ -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);
}
}