Blame SOURCES/0002-stack-tracker-Don-t-log-warnings-on-race-conditions.patch

79df40
From 58ff94c8d008ff2df35f014df24a1937cdc962ae Mon Sep 17 00:00:00 2001
79df40
From: =?UTF-8?q?Jonas=20=C3=85dahl?= <jadahl@gmail.com>
79df40
Date: Tue, 9 Jun 2020 19:09:00 +0200
79df40
Subject: [PATCH 2/2] stack-tracker: Don't log warnings on race conditions
79df40
79df40
X11 window stacking operations are by nature prone to race conditions.
79df40
For example, we might queue a "raise above" operation, but before it
79df40
actually takes place, the sibling the window was to be rased above, is
79df40
withdrawn.
79df40
79df40
In these cases we'd log warnings even though they are expected to
79df40
happen. Downgrade these warnings to debug messages, only printed when
79df40
MUTTER_VERBOSE is set.
79df40
79df40
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1300
79df40
---
79df40
 src/core/stack-tracker.c | 30 ++++++++++++++++++------------
79df40
 1 file changed, 18 insertions(+), 12 deletions(-)
79df40
79df40
diff --git a/src/core/stack-tracker.c b/src/core/stack-tracker.c
79df40
index 8f0164692f..37fd20fc59 100644
79df40
--- a/src/core/stack-tracker.c
79df40
+++ b/src/core/stack-tracker.c
79df40
@@ -372,8 +372,9 @@ meta_stack_op_apply (MetaStackTracker *tracker,
79df40
         old_pos = find_window (stack, op->add.window);
79df40
         if (old_pos >= 0)
79df40
           {
79df40
-            g_warning ("STACK_OP_ADD: window %s already in stack",
79df40
-                       get_window_desc (tracker, op->add.window));
79df40
+            meta_topic (META_DEBUG_STACK,
79df40
+                        "STACK_OP_ADD: window %s already in stack",
79df40
+                        get_window_desc (tracker, op->add.window));
79df40
             return FALSE;
79df40
           }
79df40
 
79df40
@@ -391,8 +392,9 @@ meta_stack_op_apply (MetaStackTracker *tracker,
79df40
         old_pos = find_window (stack, op->remove.window);
79df40
         if (old_pos < 0)
79df40
           {
79df40
-            g_warning ("STACK_OP_REMOVE: window %s not in stack",
79df40
-                       get_window_desc (tracker, op->remove.window));
79df40
+            meta_topic (META_DEBUG_STACK,
79df40
+                        "STACK_OP_REMOVE: window %s not in stack",
79df40
+                        get_window_desc (tracker, op->remove.window));
79df40
             return FALSE;
79df40
           }
79df40
 
79df40
@@ -407,8 +409,9 @@ meta_stack_op_apply (MetaStackTracker *tracker,
79df40
         old_pos = find_window (stack, op->raise_above.window);
79df40
         if (old_pos < 0)
79df40
           {
79df40
-            g_warning ("STACK_OP_RAISE_ABOVE: window %s not in stack",
79df40
-                       get_window_desc (tracker, op->raise_above.window));
79df40
+            meta_topic (META_DEBUG_STACK,
79df40
+                        "STACK_OP_RAISE_ABOVE: window %s not in stack",
79df40
+                        get_window_desc (tracker, op->raise_above.window));
79df40
             return FALSE;
79df40
           }
79df40
 
79df40
@@ -417,8 +420,9 @@ meta_stack_op_apply (MetaStackTracker *tracker,
79df40
             above_pos = find_window (stack, op->raise_above.sibling);
79df40
             if (above_pos < 0)
79df40
               {
79df40
-                g_warning ("STACK_OP_RAISE_ABOVE: sibling window %s not in stack",
79df40
-                           get_window_desc (tracker, op->raise_above.sibling));
79df40
+                meta_topic (META_DEBUG_STACK,
79df40
+                            "STACK_OP_RAISE_ABOVE: sibling window %s not in stack",
79df40
+                            get_window_desc (tracker, op->raise_above.sibling));
79df40
                 return FALSE;
79df40
               }
79df40
           }
79df40
@@ -438,8 +442,9 @@ meta_stack_op_apply (MetaStackTracker *tracker,
79df40
         old_pos = find_window (stack, op->raise_above.window);
79df40
         if (old_pos < 0)
79df40
           {
79df40
-            g_warning ("STACK_OP_LOWER_BELOW: window %s not in stack",
79df40
-                       get_window_desc (tracker, op->lower_below.window));
79df40
+            meta_topic (META_DEBUG_STACK,
79df40
+                        "STACK_OP_LOWER_BELOW: window %s not in stack",
79df40
+                        get_window_desc (tracker, op->lower_below.window));
79df40
             return FALSE;
79df40
           }
79df40
 
79df40
@@ -450,8 +455,9 @@ meta_stack_op_apply (MetaStackTracker *tracker,
79df40
             below_pos = find_window (stack, op->lower_below.sibling);
79df40
             if (below_pos < 0)
79df40
               {
79df40
-                g_warning ("STACK_OP_LOWER_BELOW: sibling window %s not in stack",
79df40
-                           get_window_desc (tracker, op->lower_below.sibling));
79df40
+                meta_topic (META_DEBUG_STACK,
79df40
+                            "STACK_OP_LOWER_BELOW: sibling window %s not in stack",
79df40
+                            get_window_desc (tracker, op->lower_below.sibling));
79df40
                 return FALSE;
79df40
               }
79df40
 
79df40
-- 
79df40
2.26.2
79df40