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



commit 0eab73dc2e28a52d9c01a2c6e30e32125d0048a7
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.
    
    https://gitlab.gnome.org/GNOME/mutter/merge_requests/677

 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]