[metacity] stack-tracker: fix an off-by-one error in restack_managed
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [metacity] stack-tracker: fix an off-by-one error in restack_managed
- Date: Sat, 1 Apr 2017 16:24:37 +0000 (UTC)
commit 9ccc51775fb07bb606b614507f545ae1bbd7ac76
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Fri Sep 12 17:10:34 2014 -0600
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 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/core/stack-tracker.c b/src/core/stack-tracker.c
index d7dfe32..6315b31 100644
--- a/src/core/stack-tracker.c
+++ b/src/core/stack-tracker.c
@@ -971,7 +971,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--;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]