-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path05-emptyview.diff
More file actions
61 lines (56 loc) · 1.74 KB
/
Copy path05-emptyview.diff
File metadata and controls
61 lines (56 loc) · 1.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
--- dwm-6.0-original/dwm.c 2014-01-23 19:17:20.742417045 +0100
+++ dwm-6.0/dwm.c 2014-01-28 00:04:40.874050887 +0100
@@ -322,7 +322,13 @@ 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];
+ if (c->tags & TAGMASK) {
+ c->tags = c->tags & TAGMASK;
+ } else if (c->mon->tagset[c->mon->seltags]) {
+ c->tags = c->mon->tagset[c->mon->seltags];
+ } else {
+ c->tags = 1;
+ }
}
Bool
@@ -649,7 +655,7 @@ createmon(void) {
if(!(m = (Monitor *)calloc(1, sizeof(Monitor))))
die("fatal: could not malloc() %u bytes\n", sizeof(Monitor));
- m->tagset[0] = m->tagset[1] = 1;
+ m->tagset[0] = m->tagset[1] = 0;
m->mfact = mfact;
m->nmaster = nmaster;
m->showbar = showbar;
@@ -1479,7 +1485,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);
@@ -1764,11 +1770,9 @@ void
toggleview(const Arg *arg) {
unsigned int newtagset = selmon->tagset[selmon->seltags] ^ (arg->ui & TAGMASK);
- if(newtagset) {
- selmon->tagset[selmon->seltags] = newtagset;
- focus(NULL);
- arrange(selmon);
- }
+ selmon->tagset[selmon->seltags] = newtagset;
+ focus(NULL);
+ arrange(selmon);
}
void
@@ -2043,8 +2047,9 @@ updatewmhints(Client *c) {
void
view(const Arg *arg) {
- 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)
selmon->tagset[selmon->seltags] = arg->ui & TAGMASK;