summaryrefslogtreecommitdiff
path: root/openbox
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2003-07-10 05:35:22 +0000
committerDana Jansens <danakj@orodu.net>2003-07-10 05:35:22 +0000
commit416b9d5f5f53468f954abbdffbc40003032c7f9a (patch)
tree5085defe6145d0e6bad05f860c6440e1c9854e43 /openbox
parent38d3cad2493694e5441c64d92a40eadfe8b5327e (diff)
speed up pick_group_windows too
Diffstat (limited to 'openbox')
-rw-r--r--openbox/stacking.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/openbox/stacking.c b/openbox/stacking.c
index 9309ee04..6316049a 100644
--- a/openbox/stacking.c
+++ b/openbox/stacking.c
@@ -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;
}
}
}