]> Dogcows Code - chaz/openbox/commitdiff
speed up pick_group_windows too
authorDana Jansens <danakj@orodu.net>
Thu, 10 Jul 2003 05:35:22 +0000 (05:35 +0000)
committerDana Jansens <danakj@orodu.net>
Thu, 10 Jul 2003 05:35:22 +0000 (05:35 +0000)
openbox/stacking.c

index 9309ee048c36414019b968b1fd7333f2a3da1a56..6316049ab46f30bcf9083449534d474a3a5ba61c 100644 (file)
@@ -199,7 +199,7 @@ static GList *pick_windows(Client *top, Client *selected, gboolean raise)
 static GList *pick_group_windows(Client *top, Client *selected, gboolean raise)
 {
     GList *ret = NULL;
-    GList *it, *next;
+    GList *it, *next, *prev;
     GSList *sit;
     int i, n;
 
@@ -208,12 +208,16 @@ static GList *pick_group_windows(Client *top, Client *selected, gboolean raise)
         i = 0;
         n = g_slist_length(top->group->members) - 1;
         for (it = stacking_list; i < n && it; it = next) {
+            prev = g_list_previous(it);
             next = g_list_next(it);
+
             if ((sit = g_slist_find(top->group->members, it->data))) {
                 ++i;
-                ret = g_list_concat(ret, pick_windows(sit->data,
-                                                      selected, raise)); 
-                it = stacking_list;
+                ret = g_list_concat(ret,
+                                    pick_windows(sit->data, selected, raise)); 
+                /* if we dont have a prev then start back at the beginning,
+                   otherwise skip back to the prev's next */
+                next = prev ? g_list_next(prev) : stacking_list;
             }
         }
     }
This page took 0.023893 seconds and 4 git commands to generate.