[mutter/wip/carlosg/late-allocate-invisible-actors] clutter: Defer actor allocations till shown



commit be0073a846db6ed16a0eb5069eaeb696d33791dc
Author: Carlos Garnacho <carlosg gnome org>
Date:   Sun Jul 7 13:39:35 2019 +0200

    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.

 clutter/clutter/clutter-actor.c | 3 +++
 1 file changed, 3 insertions(+)
---
diff --git a/clutter/clutter/clutter-actor.c b/clutter/clutter/clutter-actor.c
index 1fd6663b2..9546f76c3 100644
--- a/clutter/clutter/clutter-actor.c
+++ b/clutter/clutter/clutter-actor.c
@@ -10107,6 +10107,9 @@ clutter_actor_allocate (ClutterActor           *self,
       return;
     }
 
+  if (!clutter_actor_is_visible (self))
+    return;
+
   priv = self->priv;
 
   old_allocation = priv->allocation;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]