clutter/actor: Pick frame clock of parent if not on any views

An actor may be placed without being on any current stage view; in this
case, to get the ball rolling, walk up the actor tree to find the first
actor where a frame clock can be picked from.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1285
This commit is contained in:
Jonas Ådahl 2020-06-10 15:05:10 +02:00
parent f9be670522
commit aa34f6ad7c

View File

@ -16269,11 +16269,20 @@ clutter_actor_peek_stage_views (ClutterActor *self)
ClutterFrameClock *
clutter_actor_pick_frame_clock (ClutterActor *self)
{
ClutterActorPrivate *priv = self->priv;
float max_refresh_rate = 0.0;
ClutterStageView *best_view = NULL;
GList *l;
for (l = self->priv->stage_views; l; l = l->next)
if (!priv->stage_views)
{
if (priv->parent)
return clutter_actor_pick_frame_clock (priv->parent);
else
return NULL;
}
for (l = priv->stage_views; l; l = l->next)
{
ClutterStageView *view = l->data;
float refresh_rate;