diff options
author | Jonas Dreßler <verdre@v0yd.nl> | 2020-12-11 21:02:56 +0100 |
---|---|---|
committer | Marge Bot <marge-bot@gnome.org> | 2020-12-11 22:51:44 +0000 |
commit | 9693462f3250336ca2a5dae316cfd358ca5b6fee (patch) | |
tree | 48f1641f387cc8f4c755dc98a50065907077cd1e | |
parent | fbe1a16a6b5085b7d9977d20fa1efecc82f6b292 (diff) | |
download | mutter-9693462f3250336ca2a5dae316cfd358ca5b6fee.tar.gz |
clutter/actor: Use different view list when picking frame clock of stage
Apparently it can happen that a timeline tries to pick a frame clock
from an actor that's on a stage, but the actor still doesn't find a
frame clock and returns NULL.
This probably is the case when starting a timeline right after attaching
an actor to a newly created stage, so before the first stage-update
cycle. In this case clutter_actor_update_stage_views() will not have run
and the stage-actor will have priv->stage_views set to NULL even though
there are stage views.
To prevent this from happening, use the complete list of stage views
maintained by the backend when picking a frame clock for the stage.
This doesn't fix any issue appearing on master, but is correct
nonetheless.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1631>
-rw-r--r-- | clutter/clutter/clutter-actor.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/clutter/clutter/clutter-actor.c b/clutter/clutter/clutter-actor.c index 5deeae6d0..9f9a59462 100644 --- a/clutter/clutter/clutter-actor.c +++ b/clutter/clutter/clutter-actor.c @@ -15897,11 +15897,16 @@ clutter_actor_pick_frame_clock (ClutterActor *self, ClutterActor **out_actor) { ClutterActorPrivate *priv = self->priv; + GList *stage_views_list; float max_refresh_rate = 0.0; ClutterStageView *best_view = NULL; GList *l; - if (!priv->stage_views) + stage_views_list = CLUTTER_IS_STAGE (self) + ? clutter_stage_peek_stage_views (CLUTTER_STAGE (self)) + : priv->stage_views; + + if (!stage_views_list) { if (priv->parent) return clutter_actor_pick_frame_clock (priv->parent, out_actor); @@ -15909,7 +15914,7 @@ clutter_actor_pick_frame_clock (ClutterActor *self, return NULL; } - for (l = priv->stage_views; l; l = l->next) + for (l = stage_views_list; l; l = l->next) { ClutterStageView *view = l->data; float refresh_rate; |