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.
This commit is contained in:
Kirill Primak 2021-08-19 13:32:07 +03:00 committed by Simon Ser
parent d290b13871
commit 242c23743f
1 changed files with 5 additions and 8 deletions

View File

@ -313,6 +313,11 @@ static void surface_state_move(struct wlr_surface_state *state,
if (next->committed & WLR_SURFACE_STATE_VIEWPORT) { if (next->committed & WLR_SURFACE_STATE_VIEWPORT) {
memcpy(&state->viewport, &next->viewport, sizeof(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; state->committed |= next->committed;
next->committed = 0; next->committed = 0;
@ -493,14 +498,6 @@ static void surface_commit_pending(struct wlr_surface *surface) {
surface->role->precommit(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)) { if (surface->pending.cached_state_locks > 0 || !wl_list_empty(&surface->cached)) {
surface_cache_pending(surface); surface_cache_pending(surface);
} else { } else {