surface: don't cache frame callback lists

This commit is contained in:
Kirill Primak 2021-08-01 12:44:40 +03:00 committed by Simon Ser
parent 456c6e2279
commit f12bacf4b4
1 changed files with 8 additions and 5 deletions

View File

@ -327,11 +327,6 @@ static void surface_state_move(struct wlr_surface_state *state,
if (next->committed & WLR_SURFACE_STATE_BUFFER_DAMAGE) {
pixman_region32_clear(&next->buffer_damage);
}
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);
}
next->committed = 0;
next->cached_state_locks = 0;
@ -501,6 +496,14 @@ 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 {