void
incnmaster(const Arg *arg)
{
- unsigned int i;
- selmon->nmaster = MAX(selmon->nmaster + arg->i, 0);
- for(i=0; i<LENGTH(tags); ++i)
- if(selmon->tagset[selmon->seltags] & 1<<i)
- selmon->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);
}
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; i<LENGTH(tags); ++i)
- if(selmon->tagset[selmon->seltags] & 1<<i)
- {
- selmon->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
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; i<LENGTH(tags); ++i)
- if(selmon->tagset[selmon->seltags] & 1<<i)
- selmon->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);
}
void
togglebar(const Arg *arg)
{
- unsigned int i;
- selmon->showbar = !selmon->showbar;
- for(i=0; i<LENGTH(tags); ++i)
- if(selmon->tagset[selmon->seltags] & 1<<i)
- selmon->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);