From 58ff94c8d008ff2df35f014df24a1937cdc962ae 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 2/2] 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 8f0164692f..37fd20fc59 100644 --- a/src/core/stack-tracker.c +++ b/src/core/stack-tracker.c @@ -372,8 +372,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; } @@ -391,8 +392,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; } @@ -407,8 +409,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; } @@ -417,8 +420,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; } } @@ -438,8 +442,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; } @@ -450,8 +455,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; } -- 2.26.2