X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=tile.c;h=7915441d05f2e00e9a6b809ee08251965ed924c3;hb=169d96ae8fdf430fd028de74a97c8901759174be;hp=386832d66663e626f23206d0a4d19ce78b888c40;hpb=e8792d95a12c85f9e660e192cd2c6260a01a3c5e;p=dwm.git diff --git a/tile.c b/tile.c index 386832d..7915441 100644 --- a/tile.c +++ b/tile.c @@ -9,18 +9,23 @@ static double mwfact = MWFACT; /* extern */ void -addtomwfact(const char *arg) { +setmwfact(const char *arg) { double delta; if(!isarrange(tile)) return; - /* arg handling, manipulate mwfact */ if(arg == NULL) mwfact = MWFACT; else if(1 == sscanf(arg, "%lf", &delta)) { - if(delta + mwfact > 0.1 && delta + mwfact < 0.9) + if(arg[0] != '+' && arg[0] != '-') + mwfact = delta; + else mwfact += delta; + if(mwfact < 0.1) + mwfact = 0.1; + else if(mwfact > 0.9) + mwfact = 0.9; } arrange(); } @@ -41,7 +46,7 @@ tile(void) { nx = wax; ny = way; - for(i = 0, c = nexttiled(clients); c; c = nexttiled(c->next)) { + for(i = 0, c = nexttiled(clients); c; c = nexttiled(c->next), i++) { c->ismax = False; if(i == 0) { /* master */ nw = mw - 2 * c->border; @@ -61,7 +66,6 @@ tile(void) { resize(c, nx, ny, nw, nh, False); if(n > 1 && th != wah) ny += nh + 2 * c->border; - i++; } }