clutter: Defer actor allocations till shown

Currently nothing in the clutter machinery prevents hidden portions
of the actor tree from calling queue_relayout() (and having it fully
honored).

But that allocation should not be necessary till the actor is shown,
and one of the things we do on show() is queueing a relayout/redraw
after flagging the actor as visible.

We can simply defer clutter_actor_allocate() calls till that show()
call, and leave the needs_allocate and other flags set so we ensure
the allocation is properly set then.

This should cut down some needless operations when invisible portions
of the actor tree change indirectly due to user interaction, or due
to background activity.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/677
This commit is contained in:
Carlos Garnacho 2019-07-07 13:39:35 +02:00 committed by Georges Basile Stavracas Neto
parent dd8c8e82f2
commit 0eab73dc2e

View File

@ -10107,6 +10107,9 @@ clutter_actor_allocate (ClutterActor *self,
return; return;
} }
if (!clutter_actor_is_visible (self))
return;
priv = self->priv; priv = self->priv;
old_allocation = priv->allocation; old_allocation = priv->allocation;