X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;ds=sidebyside;f=view.c;h=81dd4b399823bfdf30eb452cddcf7fb452827083;hb=b233089815367983e07939b2aabb999fdc359f91;hp=4e2ffb35e526701517cf2b109e8286b91699220f;hpb=f679125206ae28b38f77e9620a67365d310ddff3;p=dwm.git diff --git a/view.c b/view.c index 4e2ffb3..81dd4b3 100644 --- a/view.c +++ b/view.c @@ -31,7 +31,7 @@ togglemax(Client *c) { c->w = c->rw; c->h = c->rh; } - resize(c, True, TopLeft); + resize(c, True); while(XCheckMaskEvent(dpy, EnterWindowMask, &ev)); } @@ -56,10 +56,10 @@ dofloat(void) { for(c = clients; c; c = c->next) { if(isvisible(c)) { - resize(c, True, TopLeft); + resize(c, True); } else - ban(c); + XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y); } if(!sel || !isvisible(sel)) { for(c = stack; c && !isvisible(c); c = c->snext); @@ -84,7 +84,7 @@ dotile(void) { for(i = 0, c = clients; c; c = c->next) if(isvisible(c)) { if(c->isfloat) { - resize(c, True, TopLeft); + resize(c, True); continue; } c->ismax = False; @@ -105,12 +105,11 @@ dotile(void) { else /* fallback if th < bh */ c->h = wah - 2 * BORDERPX; } - resize(c, False, TopLeft); + resize(c, False); i++; } else - ban(c); - + XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y); if(!sel || !isvisible(sel)) { for(c = stack; c && !isvisible(c); c = c->snext); focus(c); @@ -153,7 +152,6 @@ incnmaster(Arg *arg) { if((arrange == dofloat) || (nmaster + arg->i < 1) || (wah / (nmaster + arg->i) < bh)) return; nmaster += arg->i; - updatemodetext(); if(sel) arrange(); else @@ -187,27 +185,20 @@ restack(void) { Client *c; XEvent ev; - if(!sel) { - drawstatus(); + drawstatus(); + if(!sel) return; - } - if(sel->isfloat || arrange == dofloat) { + if(sel->isfloat || arrange == dofloat) XRaiseWindow(dpy, sel->win); - XRaiseWindow(dpy, sel->twin); - } if(arrange != dofloat) { - if(!sel->isfloat) { - XLowerWindow(dpy, sel->twin); + if(!sel->isfloat) XLowerWindow(dpy, sel->win); - } for(c = nexttiled(clients); c; c = nexttiled(c->next)) { if(c == sel) continue; - XLowerWindow(dpy, c->twin); XLowerWindow(dpy, c->win); } } - drawall(); XSync(dpy, False); while(XCheckMaskEvent(dpy, EnterWindowMask, &ev)); } @@ -223,7 +214,6 @@ togglefloat(Arg *arg) { void togglemode(Arg *arg) { arrange = (arrange == dofloat) ? dotile : dofloat; - updatemodetext(); if(sel) arrange(); else @@ -242,12 +232,6 @@ toggleview(Arg *arg) { } void -updatemodetext() { - snprintf(mtext, sizeof mtext, arrange == dofloat ? FLOATSYMBOL : TILESYMBOL, nmaster); - bmw = textw(mtext); -} - -void view(Arg *arg) { unsigned int i;