[mutter] clutter: Force an allocation on clone source if necessary



commit 08a3cbfc6cfd96f4efd8e25bc2732ad9ea7644f2
Author: Florian Müllner <fmuellner gnome org>
Date:   Mon Jul 22 21:38:33 2019 +0200

    clutter: Force an allocation on clone source if necessary
    
    Since commit 0eab73dc, actors are only allocated when they are actually
    visible. While this generally works well, it breaks - because of *course*
    it does - ClutterClones when the clone source (or any of its ancestors)
    is hidden.
    
    Force an allocation in that case to allow the clone's paint to work as
    intended.
    
    https://gitlab.gnome.org/GNOME/mutter/issues/683

 clutter/clutter/clutter-clone.c | 7 +++++++
 1 file changed, 7 insertions(+)
---
diff --git a/clutter/clutter/clutter-clone.c b/clutter/clutter/clutter-clone.c
index 53dcb6cd0..40a3d53d5 100644
--- a/clutter/clutter/clutter-clone.c
+++ b/clutter/clutter/clutter-clone.c
@@ -252,6 +252,13 @@ clutter_clone_allocate (ClutterActor           *self,
   if (priv->clone_source == NULL)
     return;
 
+  /* ClutterActor delays allocating until the actor is shown; however
+   * we cannot paint it correctly in that case, so force an allocation.
+   */
+  if (clutter_actor_get_parent (priv->clone_source) != NULL &&
+      !clutter_actor_has_allocation (priv->clone_source))
+    clutter_actor_allocate_preferred_size (priv->clone_source, flags);
+
 #if 0
   /* XXX - this is wrong: ClutterClone cannot clone unparented
    * actors, as it will break all invariants


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