dwm-emptyview-6.0.diff (1753B)
1 diff --git a/dwm.c b/dwm.c 2 index 1d78655..a526e57 100644 3 --- a/dwm.c 4 +++ b/dwm.c 5 @@ -322,7 +322,9 @@ applyrules(Client *c) { 6 XFree(ch.res_class); 7 if(ch.res_name) 8 XFree(ch.res_name); 9 - c->tags = c->tags & TAGMASK ? c->tags & TAGMASK : c->mon->tagset[c->mon->seltags]; 10 + if(c->tags & TAGMASK) c->tags = c->tags & TAGMASK; 11 + else if(c->mon->tagset[c->mon->seltags]) c->tags = c->mon->tagset[c->mon->seltags]; 12 + else c->tags = 1; 13 } 14 15 Bool 16 @@ -649,7 +651,7 @@ createmon(void) { 17 18 if(!(m = (Monitor *)calloc(1, sizeof(Monitor)))) 19 die("fatal: could not malloc() %u bytes\n", sizeof(Monitor)); 20 - m->tagset[0] = m->tagset[1] = 1; 21 + m->tagset[0] = m->tagset[1] = 0; 22 m->mfact = mfact; 23 m->nmaster = nmaster; 24 m->showbar = showbar; 25 @@ -1479,7 +1481,7 @@ sendmon(Client *c, Monitor *m) { 26 detach(c); 27 detachstack(c); 28 c->mon = m; 29 - c->tags = m->tagset[m->seltags]; /* assign tags of target monitor */ 30 + c->tags = (m->tagset[m->seltags] ? m->tagset[m->seltags] : 1); 31 attach(c); 32 attachstack(c); 33 focus(NULL); 34 @@ -1763,12 +1765,9 @@ toggletag(const Arg *arg) { 35 void 36 toggleview(const Arg *arg) { 37 unsigned int newtagset = selmon->tagset[selmon->seltags] ^ (arg->ui & TAGMASK); 38 - 39 - if(newtagset) { 40 - selmon->tagset[selmon->seltags] = newtagset; 41 - focus(NULL); 42 - arrange(selmon); 43 - } 44 + selmon->tagset[selmon->seltags] = newtagset; 45 + focus(NULL); 46 + arrange(selmon); 47 } 48 49 void 50 @@ -2043,7 +2042,7 @@ updatewmhints(Client *c) { 51 52 void 53 view(const Arg *arg) { 54 - if((arg->ui & TAGMASK) == selmon->tagset[selmon->seltags]) 55 + if(arg->ui && (arg->ui & TAGMASK) == selmon->tagset[selmon->seltags]) 56 return; 57 selmon->seltags ^= 1; /* toggle sel tagset */ 58 if(arg->ui & TAGMASK) 59 -- 60 1.8.2 61