X-Git-Url: https://git.danieliu.xyz/?p=dwm.git;a=blobdiff_plain;f=dwm.c;h=5114eeaadd056ef5071e9e9b28e4eb7d397b5d2e;hp=8b8c4c4ec804be26899480ebe96e3e8f39a2620e;hb=HEAD;hpb=ce66c62e6108a3dd1a8323c62616249e5b60ef01 diff --git a/dwm.c b/dwm.c index 8b8c4c4..5114eea 100644 --- a/dwm.c +++ b/dwm.c @@ -1085,16 +1085,7 @@ grabkeys(void) void incnmaster(const Arg *arg) { - unsigned int i; - selmon->nmaster = MAX(selmon->nmaster + arg->i, 0); - for(i=0; itagset[selmon->seltags] & 1<pertag->nmasters[i+1] = selmon->nmaster; - - if(selmon->pertag->curtag == 0) - { - selmon->pertag->nmasters[0] = selmon->nmaster; - } + selmon->nmaster = selmon->pertag->nmasters[selmon->pertag->curtag] = MAX(selmon->nmaster + arg->i, 0); arrange(selmon); } @@ -1701,26 +1692,11 @@ setgaps(const Arg *arg) void setlayout(const Arg *arg) { - unsigned int i; if (!arg || !arg->v || arg->v != selmon->lt[selmon->sellt]) - selmon->sellt ^= 1; + selmon->sellt = selmon->pertag->sellts[selmon->pertag->curtag] ^= 1; if (arg && arg->v) - selmon->lt[selmon->sellt] = (Layout *)arg->v; + selmon->lt[selmon->sellt] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt] = (Layout *)arg->v; strncpy(selmon->ltsymbol, selmon->lt[selmon->sellt]->symbol, sizeof selmon->ltsymbol); - - for(i=0; itagset[selmon->seltags] & 1<pertag->ltidxs[i+1][selmon->sellt] = selmon->lt[selmon->sellt]; - selmon->pertag->sellts[i+1] = selmon->sellt; - } - - if(selmon->pertag->curtag == 0) - { - selmon->pertag->ltidxs[0][selmon->sellt] = selmon->lt[selmon->sellt]; - selmon->pertag->sellts[0] = selmon->sellt; - } - if (selmon->sel) arrange(selmon); else @@ -1732,24 +1708,13 @@ void setmfact(const Arg *arg) { float f; - unsigned int i; if (!arg || !selmon->lt[selmon->sellt]->arrange) return; f = arg->f < 1.0 ? arg->f + selmon->mfact : arg->f - 1.0; - if (arg->f == 0.0) - f = mfact; if (f < 0.05 || f > 0.95) return; - selmon->mfact = f; - for(i=0; itagset[selmon->seltags] & 1<pertag->mfacts[i+1] = f; - - if(selmon->pertag->curtag == 0) - { - selmon->pertag->mfacts[0] = f; - } + selmon->mfact = selmon->pertag->mfacts[selmon->pertag->curtag] = f; arrange(selmon); } @@ -1932,16 +1897,7 @@ tile(Monitor *m) void togglebar(const Arg *arg) { - unsigned int i; - selmon->showbar = !selmon->showbar; - for(i=0; itagset[selmon->seltags] & 1<pertag->showbars[i+1] = selmon->showbar; - - if(selmon->pertag->curtag == 0) - { - selmon->pertag->showbars[0] = selmon->showbar; - } + selmon->showbar = selmon->pertag->showbars[selmon->pertag->curtag] = !selmon->showbar; updatebarpos(selmon); XMoveResizeWindow(dpy, selmon->barwin, selmon->wx + sp, selmon->by + vp, selmon->ww - 2 * sp, bh); arrange(selmon);