dwm-noxz

[fork] suckless dwm - personal fork
git clone git://git.noxz.tech/dwm-noxz
Log | Files | Refs | README | LICENSE

commit 51e70c770ea3331eb8f30612aeaf060e396e08ca
parent eaf814ec27383157dc09570b107292e7115762c0
Author: Chris Noxz <chris@noxz.tech>
Date:   Tue,  4 Feb 2020 22:34:09 +0100

Implement emptyview

Diffstat:
Mdwm.c | 23+++++++++++++----------
1 file changed, 13 insertions(+), 10 deletions(-)

diff --git a/dwm.c b/dwm.c @@ -340,7 +340,10 @@ applyrules(Client *c) XFree(ch.res_class); if (ch.res_name) XFree(ch.res_name); - c->tags = c->tags & TAGMASK ? c->tags & TAGMASK : c->mon->tagset[c->mon->seltags]; + c->tags = c->tags & TAGMASK ? c->tags & TAGMASK + : c->mon->tagset[c->mon->seltags] + ? c->mon->tagset[c->mon->seltags] + : 1; } int @@ -1672,7 +1675,7 @@ sendmon(Client *c, Monitor *m) detach(c); detachstack(c); c->mon = m; - c->tags = m->tagset[m->seltags]; /* assign tags of target monitor */ + c->tags = (m->tagset[m->seltags] ? m->tagset[m->seltags] : 1); attach(c); attachstack(c); focus(NULL); @@ -2178,28 +2181,28 @@ toggleview(const Arg *arg) int i; if (newtagset) { - selmon->tagset[selmon->seltags] = newtagset; if (newtagset == ~0) { selmon->pertag->prevtag = selmon->pertag->curtag; selmon->pertag->curtag = 0; } - /* test if the user did not select the same tag */ if (!(newtagset & 1 << (selmon->pertag->curtag - 1))) { selmon->pertag->prevtag = selmon->pertag->curtag; - for (i = 0; !(newtagset & 1 << i); i++) ; + for (i = 0; !(newtagset & 1 << i); i++); selmon->pertag->curtag = i + 1; } + selmon->tagset[selmon->seltags] = newtagset; /* apply settings for this view */ selmon->nmaster = selmon->pertag->nmasters[selmon->pertag->curtag]; selmon->mfact = selmon->pertag->mfacts[selmon->pertag->curtag]; selmon->sellt = selmon->pertag->sellts[selmon->pertag->curtag]; selmon->lt[selmon->sellt] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt]; - selmon->lt[selmon->sellt^1] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt^1]; - - if (selmon->showbar != selmon->pertag->showbars[selmon->pertag->curtag]) - togglebar(NULL); + selmon->lt[selmon->sellt ^ 1] = selmon->pertag->ltidxs[selmon->pertag->curtag][selmon->sellt^1]; + focus(NULL); + arrange(selmon); + } else { + selmon->tagset[selmon->seltags] = newtagset; focus(NULL); arrange(selmon); } @@ -2497,7 +2500,7 @@ view(const Arg *arg) int i; unsigned int tmptag; - if ((arg->ui & TAGMASK) == selmon->tagset[selmon->seltags]) + if (arg->ui && (arg->ui & TAGMASK) == selmon->tagset[selmon->seltags]) return; selmon->seltags ^= 1; /* toggle sel tagset */ if (arg->ui & TAGMASK) {