diff options
author | Kirill Primak <vyivel@posteo.net> | 2021-08-19 13:32:07 +0300 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2021-09-06 17:37:08 +0200 |
commit | 242c23743f6c7855ab32591894f08e9005599b0c (patch) | |
tree | a29c5c67319c1dd1dd2a53ace86ad8699e6b9ebf | |
parent | d290b13871fa18dcad6cd90d9ee93e7205742124 (diff) |
surface: cache frame callback lists again
Caching frame callback lists is actually the correct behavior, because
if a surface is locked because of e.g. subsurface synchronization,
clients would expect to receive frame done events only after the
pending state is actually committed.
-rw-r--r-- | types/wlr_surface.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/types/wlr_surface.c b/types/wlr_surface.c index 66d52ab2..eec70474 100644 --- a/types/wlr_surface.c +++ b/types/wlr_surface.c @@ -313,6 +313,11 @@ static void surface_state_move(struct wlr_surface_state *state, if (next->committed & WLR_SURFACE_STATE_VIEWPORT) { memcpy(&state->viewport, &next->viewport, sizeof(state->viewport)); } + if (next->committed & WLR_SURFACE_STATE_FRAME_CALLBACK_LIST) { + wl_list_insert_list(&state->frame_callback_list, + &next->frame_callback_list); + wl_list_init(&next->frame_callback_list); + } state->committed |= next->committed; next->committed = 0; @@ -493,14 +498,6 @@ static void surface_commit_pending(struct wlr_surface *surface) { surface->role->precommit(surface); } - // It doesn't to make sense to cache callback lists, so we always move - // them to the current state. - if (surface->pending.committed & WLR_SURFACE_STATE_FRAME_CALLBACK_LIST) { - wl_list_insert_list(&surface->current.frame_callback_list, - &surface->pending.frame_callback_list); - wl_list_init(&surface->pending.frame_callback_list); - } - if (surface->pending.cached_state_locks > 0 || !wl_list_empty(&surface->cached)) { surface_cache_pending(surface); } else { |