diff options
author | Kirill Primak <vyivel@posteo.net> | 2021-08-01 12:44:40 +0300 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2021-08-02 09:10:10 +0200 |
commit | f12bacf4b41e183f9efb352e20db60c7cc3898db (patch) | |
tree | bf34ffa9828d2ecbde3a35ecc73e4d85b5b028f6 | |
parent | 456c6e227972dd1be26fbedd77b0784bb1879a26 (diff) |
surface: don't cache frame callback lists
-rw-r--r-- | types/wlr_surface.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/types/wlr_surface.c b/types/wlr_surface.c index 5d44c001..e9979bb1 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 { |