- GList *it;
- GSList *sit;
-
- for (it = g_list_last(stacking_list); it; it = it->prev)
- for (sit = c->transients; sit; sit = sit->next)
- if (it->data == sit->data) /* found a transient */
- return it;
- return NULL;
-}
-
-static void raise_recursive(ObWindow *window)
-{
- Window wins[2]; /* only ever restack 2 windows. */
- GList *it, *low;
- GSList *sit;
-
- g_assert(stacking_list != NULL); /* this would be bad */
-
- /* remove the window before looking so we can't run into ourselves and our
- transients can't either. */
- stacking_list = g_list_remove(stacking_list, window);
-
- /* raise transients first */
- if (WINDOW_IS_CLIENT(window)) {
- Client *client = WINDOW_AS_CLIENT(window);
- for (sit = client->transients; sit; sit = sit->next)
- raise_recursive(sit->data);
+ GList *it, *next;
+ Window *win;
+ int i;
+
+ /* pls only restack stuff in the same layer at a time */
+ for (it = wins; it; it = next) {
+ next = g_list_next(it);
+ if (!next) break;
+ g_assert (window_layer(it->data) == window_layer(next->data));