X-Git-Url: https://git.danieliu.xyz/?a=blobdiff_plain;f=layout.c;h=f8c92ee23790a4c46b0d8f0c793925e169a11de2;hb=f2190c8fc21a7d2408b3025ad92c853c035351cc;hp=de6aef63903ed61a5a922cb2c9e97d156c4062cf;hpb=199a6016114875656102d11e79a80939bfaff3b3;p=dwm.git diff --git a/layout.c b/layout.c index de6aef6..f8c92ee 100644 --- a/layout.c +++ b/layout.c @@ -1,6 +1,4 @@ -/* © 2006-2007 Anselm R. Garbe - * © 2006-2007 Sander van Dijk - * See LICENSE file for license details. */ +/* See LICENSE file for copyright and license details. */ #include "dwm.h" #include @@ -13,22 +11,6 @@ static unsigned int nlayouts = 0; static unsigned int masterw = MASTERWIDTH; static unsigned int nmaster = NMASTER; -static void -ban(Client *c) { - if (c->isbanned) - return; - XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y); - c->isbanned = True; -} - -static void -unban(Client *c) { - if (!c->isbanned) - return; - XMoveWindow(dpy, c->win, c->x, c->y); - c->isbanned = False; -} - static void tile(void) { unsigned int i, n, nx, ny, nw, nh, mw, mh, tw, th; @@ -90,9 +72,7 @@ floating(void) { for(c = clients; c; c = c->next) if(isvisible(c)) { - if(c->isbanned) - XMoveWindow(dpy, c->win, c->x, c->y); - c->isbanned = False; + unban(c); resize(c, c->x, c->y, c->w, c->h, True); } else @@ -184,6 +164,7 @@ void restack(void) { Client *c; XEvent ev; + XWindowChanges wc; drawstatus(); if(!sel) @@ -191,12 +172,17 @@ restack(void) { if(sel->isfloating || lt->arrange == floating) XRaiseWindow(dpy, sel->win); if(lt->arrange != floating) { - if(!sel->isfloating) - XLowerWindow(dpy, sel->win); + wc.stack_mode = Below; + wc.sibling = barwin; + if(!sel->isfloating) { + XConfigureWindow(dpy, sel->win, CWSibling | CWStackMode, &wc); + wc.sibling = sel->win; + } for(c = nexttiled(clients); c; c = nexttiled(c->next)) { if(c == sel) continue; - XLowerWindow(dpy, c->win); + XConfigureWindow(dpy, c->win, CWSibling | CWStackMode, &wc); + wc.sibling = c->win; } } XSync(dpy, False); @@ -245,7 +231,7 @@ togglemax(const char *arg) { sel->ry = sel->y; sel->rw = sel->w; sel->rh = sel->h; - resize(sel, wax, way, waw - 2 * BORDERPX, wah - 2 * BORDERPX, True); + resize(sel, wax, way, waw - 2 * sel->border, wah - 2 * sel->border, True); } else resize(sel, sel->rx, sel->ry, sel->rw, sel->rh, True);