X-Git-Url: https://git.danieliu.xyz/?a=blobdiff_plain;f=layout.c;h=8756e0018c8a95cbd6a9bfcf73012a8085429b3a;hb=fe5acb939a5764901b4fa46e1822eb5958752a1a;hp=1e8f113484d834edd55d7c3d5c59c507f9ca7419;hpb=27b0595af72060d7cc406639b6c53a854f0a3590;p=dwm.git diff --git a/layout.c b/layout.c index 1e8f113..8756e00 100644 --- a/layout.c +++ b/layout.c @@ -31,7 +31,7 @@ tile(void) { if(c->isbanned) XMoveWindow(dpy, c->win, c->x, c->y); c->isbanned = False; - if(c->isversatile) + if(c->isuntiled) continue; c->ismax = False; nx = wax; @@ -75,21 +75,17 @@ focusclient(const char *arg) { if(!sel || !arg) return; - switch(atoi(arg)) { - default: - return; - case 1: - for(c = sel->next; c && !isvisible(c); c = c->next); - if(!c) - for(c = clients; c && !isvisible(c); c = c->next); - break; - case -1: + if(atoi(arg) < 0) { for(c = sel->prev; c && !isvisible(c); c = c->prev); if(!c) { for(c = clients; c && c->next; c = c->next); for(; c && !isvisible(c); c = c->prev); } - break; + } + else { + for(c = sel->next; c && !isvisible(c); c = c->next); + if(!c) + for(c = clients; c && !isvisible(c); c = c->next); } if(c) { focus(c); @@ -148,7 +144,7 @@ initlayouts(void) { Client * nexttiled(Client *c) { - for(; c && (c->isversatile || !isvisible(c)); c = c->next); + for(; c && (c->isuntiled || !isvisible(c)); c = c->next); return c; } @@ -160,10 +156,10 @@ restack(void) { drawstatus(); if(!sel) return; - if(sel->isversatile || lt->arrange == versatile) + if(sel->isuntiled || lt->arrange == untile) XRaiseWindow(dpy, sel->win); - if(lt->arrange != versatile) { - if(!sel->isversatile) + if(lt->arrange != untile) { + if(!sel->isuntiled) XLowerWindow(dpy, sel->win); for(c = nexttiled(clients); c; c = nexttiled(c->next)) { if(c == sel) @@ -202,7 +198,7 @@ void togglemax(const char *arg) { XEvent ev; - if(!sel || (lt->arrange != versatile && !sel->isversatile) || sel->isfixed) + if(!sel || (lt->arrange != untile && !sel->isuntiled) || sel->isfixed) return; if((sel->ismax = !sel->ismax)) { sel->rx = sel->x; @@ -218,7 +214,7 @@ togglemax(const char *arg) { } void -versatile(void) { +untile(void) { Client *c; for(c = clients; c; c = c->next) { @@ -245,7 +241,7 @@ zoom(const char *arg) { unsigned int n; Client *c; - if(!sel || lt->arrange != tile || sel->isversatile) + if(!sel || lt->arrange != tile || sel->isuntiled) return; for(n = 0, c = nexttiled(clients); c; c = nexttiled(c->next)) n++;