From a676249c0cf1f1f3857f08ce4cd66638dc140c04 Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Fri, 12 Sep 2014 17:10:34 -0600 Subject: [PATCH] stack-tracker: Fix an off-by-one error in restack_managed When restacking the last window alone, we would trigger this off-by-one error. This would throw us off the end of the array, causing lower_below warnings for nonsensical values. Since the last window already is lowered below everything else, we shouldn't need to lower it. --- src/core/stack-tracker.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/stack-tracker.c b/src/core/stack-tracker.c index 0187f9634..5dbac54f3 100644 --- a/src/core/stack-tracker.c +++ b/src/core/stack-tracker.c @@ -1107,7 +1107,7 @@ meta_stack_tracker_restack_managed (MetaStackTracker *tracker, new_pos--; } - while (new_pos >= 0) + while (new_pos > 0) { meta_stack_tracker_lower_below (tracker, managed[new_pos], managed[new_pos - 1]); new_pos--;