[mutter] stack-tracker: Fix an off-by-one error in restack_managed



commit a676249c0cf1f1f3857f08ce4cd66638dc140c04
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 0187f96..5dbac54 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--;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]