[metacity] compositor: avoid full redraw if stack did not change



commit 9355d362096ba2bd9e0f1e3d8ad9d8b0861b0ddb
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Sun Oct 13 00:37:22 2019 +0300

    compositor: avoid full redraw if stack did not change

 src/compositor/meta-compositor.c | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)
---
diff --git a/src/compositor/meta-compositor.c b/src/compositor/meta-compositor.c
index 1c41eced..72bf364a 100644
--- a/src/compositor/meta-compositor.c
+++ b/src/compositor/meta-compositor.c
@@ -607,13 +607,36 @@ meta_compositor_sync_stack (MetaCompositor *compositor,
                             GList          *stack)
 {
   MetaCompositorPrivate *priv;
+  gboolean changed;
   GList *l1;
+  GList *l2;
 
   priv = meta_compositor_get_instance_private (compositor);
 
   if (priv->stack == NULL)
     return;
 
+  changed = FALSE;
+  for (l1 = stack, l2 = priv->stack;
+       l1 != NULL && l2 != NULL;
+       l1 = l1->next, l2 = l2->next)
+    {
+      MetaWindow *window;
+      MetaSurface *surface;
+
+      window = META_WINDOW (l1->data);
+      surface = g_hash_table_lookup (priv->surfaces, window);
+
+      if (surface != META_SURFACE (l2->data))
+        {
+          changed = TRUE;
+          break;
+        }
+    }
+
+  if (!changed)
+    return;
+
   for (l1 = stack; l1 != NULL; l1 = l1->next)
     {
       MetaWindow *window;


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