about summary refs log tree commit diff stats
path: root/dwm.c
diff options
context:
space:
mode:
authorAnselm R Garbe <garbeam@gmail.com>2008-04-27 18:33:31 +0100
committerAnselm R Garbe <garbeam@gmail.com>2008-04-27 18:33:31 +0100
commitbfd6079a155c9429b7b963b678b4a83acab07cd2 (patch)
tree6036a36ccf6a419055f07c9d55e1fd4562fbb1ad /dwm.c
parent7f70d90219c4a33c79ff93b49fb24ee7a6f62b4d (diff)
downloaddwm-bfd6079a155c9429b7b963b678b4a83acab07cd2.tar.gz
applied yiyus tagset patch
Diffstat (limited to 'dwm.c')
-rw-r--r--dwm.c37
1 files changed, 16 insertions, 21 deletions
diff --git a/dwm.c b/dwm.c
index a77f4c8..3717b90 100644
--- a/dwm.c
+++ b/dwm.c
@@ -214,7 +214,7 @@ char stext[256];
 int screen, sx, sy, sw, sh;
 int (*xerrorxlib)(Display *, XErrorEvent *);
 int bx, by, bw, bh, blw, bgw, mx, my, mw, mh, mox, moy, mow, moh, tx, ty, tw, th, wx, wy, ww, wh;
-int viewtags_set = 0;
+int seltags = 0;
 double mfact;
 unsigned int numlockmask = 0;
 void (*handler[LASTEvent]) (XEvent *) = {
@@ -234,8 +234,7 @@ void (*handler[LASTEvent]) (XEvent *) = {
 Atom wmatom[WMLast], netatom[NetLast];
 Bool otherwm, readin;
 Bool running = True;
-Bool *seltags;
-Bool *viewtags[2];
+Bool *tagset[2];
 Client *clients = NULL;
 Client *sel = NULL;
 Client *stack = NULL;
@@ -278,7 +277,7 @@ applyrules(Client *c) {
 	if(ch.res_name)
 		XFree(ch.res_name);
 	if(!matched)
-		memcpy(c->tags, seltags, TAGSZ);
+		memcpy(c->tags, tagset[seltags], TAGSZ);
 }
 
 void
@@ -538,7 +537,7 @@ drawbar(void) {
 	for(c = stack; c && !isvisible(c); c = c->snext);
 	for(i = 0; i < LENGTH(tags); i++) {
 		dc.w = textw(tags[i]);
-		if(seltags[i]) {
+		if(tagset[seltags][i]) {
 			drawtext(tags[i], dc.sel, isurgent(i));
 			drawsquare(c && c->tags[i], isoccupied(i), isurgent(i), dc.sel);
 		}
@@ -933,7 +932,7 @@ isvisible(Client *c) {
 	unsigned int i;
 
 	for(i = 0; i < LENGTH(tags); i++)
-		if(c->tags[i] && seltags[i])
+		if(c->tags[i] && tagset[seltags][i])
 			return True;
 	return False;
 }
@@ -1505,10 +1504,9 @@ setup(void) {
 		XSetFont(dpy, dc.gc, dc.font.xfont->fid);
 
 	/* init tags */
-	viewtags[0] = emallocz(TAGSZ);
-	viewtags[1] = emallocz(TAGSZ);
-	viewtags[0][0] = viewtags[1][0] = True;
-	seltags = viewtags[0];
+	tagset[0] = emallocz(TAGSZ);
+	tagset[1] = emallocz(TAGSZ);
+	tagset[0][0] = tagset[1][0] = True;
 
 	/* init bar */
 	for(blw = i = 0; LENGTH(layouts) > 1 && i < LENGTH(layouts); i++) {
@@ -1701,10 +1699,10 @@ toggleview(const char *arg) {
 	unsigned int i, j;
 
 	i = idxoftag(arg);
-	seltags[i] = !seltags[i];
-	for(j = 0; j < LENGTH(tags) && !seltags[j]; j++);
+	tagset[seltags][i] = !tagset[seltags][i];
+	for(j = 0; j < LENGTH(tags) && !tagset[seltags][j]; j++);
 	if(j == LENGTH(tags))
-		seltags[i] = True; /* at least one tag must be viewed */
+		tagset[seltags][i] = True; /* at least one tag must be viewed */
 	arrange();
 }
 
@@ -1837,18 +1835,15 @@ view(const char *arg) {
 		tmp[i] = (NULL == arg);
 	tmp[idxoftag(arg)] = True;
 
-	if(memcmp(seltags, tmp, TAGSZ) != 0) {
-		seltags = viewtags[viewtags_set ^= 1];  /* toggle tagset */
-		memcpy(seltags, tmp, TAGSZ);
-		arrange();
-	}
-	else
-		viewprevtag(NULL);
+	seltags ^= 1; /* toggle sel tagset */
+	if(memcmp(tagset[seltags ^ 1], tmp, TAGSZ) != 0)
+		memcpy(tagset[seltags], tmp, TAGSZ);
+	arrange();
 }
 
 void
 viewprevtag(const char *arg) {
-	seltags = viewtags[viewtags_set ^= 1];  /* toggle tagset */
+	seltags ^= 1; /* toggle sel tagset */
 	arrange();
 }
 
1-13 13:25:56 -0500 committer Drew DeVault <sir@cmpwn.com> 2019-01-13 13:25:56 -0500 Move status line into account, update behavior' href='/akspecs/aerc/commit/widgets/account.go?h=0.2.1&id=b76deea9635d56bfa740127683e43bf817f5e3be'>b76deea ^
24dfc47 ^
b76deea ^
2dc4365 ^

c286d3d ^
589db74 ^



c286d3d ^
b76deea ^
0911cd5 ^
99c363b ^
150a271 ^
2279ac3 ^

2349b7d ^
fcdcd32 ^
0f8b7a1 ^

24dfc47 ^
1b673b5 ^







0911cd5 ^


0911cd5 ^
24dfc47 ^

589db74 ^
0911cd5 ^
24dfc47 ^
0911cd5 ^

a15ea01 ^
2dc4365 ^


a15ea01 ^









17bd2dc ^



475b697 ^







62946ff ^
24dfc47 ^
62946ff ^

607ece8 ^
1228448 ^


648ca98 ^
b76deea ^


648ca98 ^








c286d3d ^
589db74 ^

c286d3d ^
2349b7d ^

5de1bb8 ^
2349b7d ^
589db74 ^
cf66462 ^



77c76ba ^
cf66462 ^



626f91c ^
cf66462 ^

99c363b ^


cf66462 ^
589db74 ^
cf66462 ^
2349b7d ^

b60999c ^




24daef8 ^



753adb9 ^



363aab5 ^



217e85a ^
f81e4bd ^
217e85a ^


753adb9 ^

363aab5 ^

753adb9 ^

b60999c ^
b389647 ^



1b673b5 ^
4ec7f5d ^







acfe7d7 ^

b389647 ^

1b673b5 ^
b389647 ^

dc4c36a ^




1b673b5 ^
026e8a1 ^



b389647 ^

1b673b5 ^
5090a4c ^

0abafa6 ^
1b673b5 ^
5090a4c ^

b389647 ^
1b673b5 ^
5090a4c ^

312a53e ^
1b673b5 ^
5090a4c ^

b389647 ^

589db74 ^
2958579 ^
b389647 ^
b60999c ^
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236