From 53f61f3778a41bb2e316e55eb7e6dd864b3dd573 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Tue, 9 Jun 2020 19:09:00 +0200 Subject: [PATCH] stack-tracker: Don't log warnings on race conditions X11 window stacking operations are by nature prone to race conditions. For example, we might queue a "raise above" operation, but before it actually takes place, the sibling the window was to be rased above, is withdrawn. In these cases we'd log warnings even though they are expected to happen. Downgrade these warnings to debug messages, only printed when MUTTER_VERBOSE is set. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1300 --- src/core/stack-tracker.c | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/src/core/stack-tracker.c b/src/core/stack-tracker.c index 8d15b80c9..96ffabcee 100644 --- a/src/core/stack-tracker.c +++ b/src/core/stack-tracker.c @@ -381,8 +381,9 @@ meta_stack_op_apply (MetaStackTracker *tracker, old_pos = find_window (stack, op->add.window); if (old_pos >= 0) { - g_warning ("STACK_OP_ADD: window %s already in stack", - get_window_desc (tracker, op->add.window)); + meta_topic (META_DEBUG_STACK, + "STACK_OP_ADD: window %s already in stack", + get_window_desc (tracker, op->add.window)); return FALSE; } @@ -400,8 +401,9 @@ meta_stack_op_apply (MetaStackTracker *tracker, old_pos = find_window (stack, op->remove.window); if (old_pos < 0) { - g_warning ("STACK_OP_REMOVE: window %s not in stack", - get_window_desc (tracker, op->remove.window)); + meta_topic (META_DEBUG_STACK, + "STACK_OP_REMOVE: window %s not in stack", + get_window_desc (tracker, op->remove.window)); return FALSE; } @@ -416,8 +418,9 @@ meta_stack_op_apply (MetaStackTracker *tracker, old_pos = find_window (stack, op->raise_above.window); if (old_pos < 0) { - g_warning ("STACK_OP_RAISE_ABOVE: window %s not in stack", - get_window_desc (tracker, op->raise_above.window)); + meta_topic (META_DEBUG_STACK, + "STACK_OP_RAISE_ABOVE: window %s not in stack", + get_window_desc (tracker, op->raise_above.window)); return FALSE; } @@ -426,8 +429,9 @@ meta_stack_op_apply (MetaStackTracker *tracker, above_pos = find_window (stack, op->raise_above.sibling); if (above_pos < 0) { - g_warning ("STACK_OP_RAISE_ABOVE: sibling window %s not in stack", - get_window_desc (tracker, op->raise_above.sibling)); + meta_topic (META_DEBUG_STACK, + "STACK_OP_RAISE_ABOVE: sibling window %s not in stack", + get_window_desc (tracker, op->raise_above.sibling)); return FALSE; } } @@ -447,8 +451,9 @@ meta_stack_op_apply (MetaStackTracker *tracker, old_pos = find_window (stack, op->raise_above.window); if (old_pos < 0) { - g_warning ("STACK_OP_LOWER_BELOW: window %s not in stack", - get_window_desc (tracker, op->lower_below.window)); + meta_topic (META_DEBUG_STACK, + "STACK_OP_LOWER_BELOW: window %s not in stack", + get_window_desc (tracker, op->lower_below.window)); return FALSE; } @@ -459,8 +464,9 @@ meta_stack_op_apply (MetaStackTracker *tracker, below_pos = find_window (stack, op->lower_below.sibling); if (below_pos < 0) { - g_warning ("STACK_OP_LOWER_BELOW: sibling window %s not in stack", - get_window_desc (tracker, op->lower_below.sibling)); + meta_topic (META_DEBUG_STACK, + "STACK_OP_LOWER_BELOW: sibling window %s not in stack", + get_window_desc (tracker, op->lower_below.sibling)); return FALSE; }