Blame SOURCES/0002-clutter-Avoid-relayouts-when-raising-lowering-childr.patch

9501a8
From dcf0717d7d90ff525c4f87cf633353caabf0eeeb Mon Sep 17 00:00:00 2001
9501a8
From: Carlos Garnacho <carlosg@gnome.org>
9501a8
Date: Fri, 10 Aug 2018 21:30:58 +0200
9501a8
Subject: [PATCH 2/2] clutter: Avoid relayouts when raising/lowering children
9501a8
9501a8
These calls don't actually affect the layout, but the paint order.
9501a8
It seems safe to skip the full relayout/repaint of the parent actor,
9501a8
and redraw only the area occupied by the affected child.
9501a8
---
9501a8
 clutter/clutter/clutter-actor.c | 20 ++++++++++++++++++--
9501a8
 1 file changed, 18 insertions(+), 2 deletions(-)
9501a8
9501a8
diff --git a/clutter/clutter/clutter-actor.c b/clutter/clutter/clutter-actor.c
9501a8
index 6954f0396..7a9da7257 100644
9501a8
--- a/clutter/clutter/clutter-actor.c
9501a8
+++ b/clutter/clutter/clutter-actor.c
9501a8
@@ -1713,6 +1713,22 @@ set_show_on_set_parent (ClutterActor *self,
9501a8
     }
9501a8
 }
9501a8
 
9501a8
+static void
9501a8
+clutter_actor_queue_redraw_on_parent (ClutterActor *self)
9501a8
+{
9501a8
+  const ClutterPaintVolume *pv;
9501a8
+
9501a8
+  if (!self->priv->parent)
9501a8
+    return;
9501a8
+
9501a8
+  /* A relayout/redraw is underway */
9501a8
+  if (self->priv->needs_allocation)
9501a8
+    return;
9501a8
+
9501a8
+  pv = clutter_actor_get_transformed_paint_volume (self, self->priv->parent);
9501a8
+  _clutter_actor_queue_redraw_with_clip (self->priv->parent, 0, pv);
9501a8
+}
9501a8
+
9501a8
 /**
9501a8
  * clutter_actor_show:
9501a8
  * @self: A #ClutterActor
9501a8
@@ -13618,7 +13634,7 @@ clutter_actor_set_child_above_sibling (ClutterActor *self,
9501a8
                                     sibling);
9501a8
   g_object_unref(child);
9501a8
 
9501a8
-  clutter_actor_queue_relayout (self);
9501a8
+  clutter_actor_queue_redraw_on_parent (child);
9501a8
 }
9501a8
 
9501a8
 /**
9501a8
@@ -13665,7 +13681,7 @@ clutter_actor_set_child_below_sibling (ClutterActor *self,
9501a8
                                     sibling);
9501a8
   g_object_unref(child);
9501a8
 
9501a8
-  clutter_actor_queue_relayout (self);
9501a8
+  clutter_actor_queue_redraw_on_parent (child);
9501a8
 }
9501a8
 
9501a8
 /**
9501a8
-- 
9501a8
2.21.0
9501a8