X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Fstacking.c;h=c3d485f5427b96c1a3dab9b40d44cdc446d8dd11;hb=276b2be581c6cb138b439537761ff2ca42201805;hp=9309ee048c36414019b968b1fd7333f2a3da1a56;hpb=38d3cad2493694e5441c64d92a40eadfe8b5327e;p=chaz%2Fopenbox diff --git a/openbox/stacking.c b/openbox/stacking.c index 9309ee04..c3d485f5 100644 --- a/openbox/stacking.c +++ b/openbox/stacking.c @@ -18,7 +18,7 @@ void stacking_set_list() /* on shutdown, don't update the properties, so that we can read it back in on startup and re-stack the windows as they were before we shut down */ - if (ob_state == State_Exiting) return; + if (ob_state == OB_STATE_EXITING) return; /* create an array of the window ids (from bottom to top, reverse order!) */ @@ -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; } } }