Refactoring restack to allow it to work without having the bar as a reference ref. #214

pull/208/head
bakkeby 2 years ago
parent b17ea8e2de
commit 5c80a54b62

14
dwm.c

@ -3000,7 +3000,7 @@ resizemouse(const Arg *arg)
void
restack(Monitor *m)
{
Client *c;
Client *c, *f = NULL;
XEvent ev;
XWindowChanges wc;
#if WARP_PATCH && FLEXTILE_DELUXE_LAYOUT
@ -3015,11 +3015,17 @@ restack(Monitor *m)
return;
if (m->sel->isfloating || !m->lt[m->sellt]->arrange)
XRaiseWindow(dpy, m->sel->win);
if (m->lt[m->sellt]->arrange && m->bar) {
if (m->lt[m->sellt]->arrange) {
wc.stack_mode = Below;
wc.sibling = m->bar->win;
if (m->bar) {
wc.sibling = m->bar->win;
} else {
for (f = m->stack; f && (f->isfloating || !ISVISIBLE(f)); f = f->snext); // find first tiled stack client
if (f)
wc.sibling = f->win;
}
for (c = m->stack; c; c = c->snext)
if (!c->isfloating && ISVISIBLE(c)) {
if (!c->isfloating && ISVISIBLE(c) && c != f) {
XConfigureWindow(dpy, c->win, CWSibling|CWStackMode, &wc);
wc.sibling = c->win;
}

Loading…
Cancel
Save