From f12bacf4b41e183f9efb352e20db60c7cc3898db Mon Sep 17 00:00:00 2001 From: Kirill Primak Date: Sun, 1 Aug 2021 12:44:40 +0300 Subject: [PATCH] surface: don't cache frame callback lists --- types/wlr_surface.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/types/wlr_surface.c b/types/wlr_surface.c index 5d44c0010..e9979bb16 100644 --- a/types/wlr_surface.c +++ b/types/wlr_surface.c @@ -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 {