- g_assert(it != NULL);
-
- wins[0] = (it == stacking_list ? focus_backup :
- ((Client*)it->prev->data)->frame->window);
- wins[1] = client->frame->window;
- if (wins[0] == wins[1]) return; /* already right above the window */
-
- stacking_list = g_list_remove(stacking_list, client);
- stacking_list = g_list_insert_before(stacking_list, it, client);
- } else {
- lower_no_parent:
-
- it = g_list_last(stacking_list);
-
- while (it != stacking_list) {
- Client *c = it->data;
- if (client->layer <= c->layer)
- break;
- it = it->prev;
- }
- if (it->data == client) return; /* already the bottom, return */
-
- wins[0] = ((Client*)it->data)->frame->window;
- wins[1] = client->frame->window;
-
- stacking_list = g_list_remove(stacking_list, client);
- stacking_list = g_list_insert_before(stacking_list,
- it->next, client);