[mutter/gnome-3-38] clutter/actor: Alway call queue_relayout() when showing actors



commit 127573e5faba62fc9c8a0e0ad170e34cc3b3436c
Author: Jonas Dreßler <verdre v0yd nl>
Date:   Thu Jul 2 16:41:43 2020 +0000

    clutter/actor: Alway call queue_relayout() when showing actors
    
    clutter_actor_queue_relayout() detects whether a parent has the
    NO_LAYOUT flag set by itself and then queues a shallow relayout for us.
    There's no need to duplicate that logic when showing actors, so simply
    call clutter_actor_queue_relayout() and let that handle it.
    
    https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1366
    
    
    (cherry picked from commit 734a7cc16f9fba91a4b21ce1f8defec0cfddcbc5)

 clutter/clutter/clutter-actor.c | 26 +++++---------------------
 1 file changed, 5 insertions(+), 21 deletions(-)
---
diff --git a/clutter/clutter/clutter-actor.c b/clutter/clutter/clutter-actor.c
index da610f4cf9..2198b96d83 100644
--- a/clutter/clutter/clutter-actor.c
+++ b/clutter/clutter/clutter-actor.c
@@ -1788,28 +1788,12 @@ clutter_actor_real_show (ClutterActor *self)
    */
   clutter_actor_update_map_state (self, MAP_STATE_CHECK);
 
-  /* we queue a relayout unless the actor is inside a
-   * container that explicitly told us not to
-   */
-  if (priv->parent != NULL &&
-      (!(priv->parent->flags & CLUTTER_ACTOR_NO_LAYOUT)))
-    {
-      /* While an actor is hidden the parent may not have
-       * allocated/requested so we need to start from scratch
-       * and avoid the short-circuiting in
-       * clutter_actor_queue_relayout().
-       */
-      priv->needs_width_request  = FALSE;
-      priv->needs_height_request = FALSE;
-      priv->needs_allocation     = FALSE;
+  /* Avoid the early return in clutter_actor_queue_relayout() */
+  priv->needs_width_request = FALSE;
+  priv->needs_height_request = FALSE;
+  priv->needs_allocation = FALSE;
 
-      clutter_actor_queue_relayout (self);
-    }
-  else  /* but still don't leave the actor un-allocated before showing it */
-    {
-      clutter_actor_queue_shallow_relayout (self);
-      clutter_actor_queue_redraw (self);
-    }
+  clutter_actor_queue_relayout (self);
 }
 
 static inline void


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