about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAnselm R Garbe <garbeam@gmail.com>2008-02-11 20:48:22 +0000
committerAnselm R Garbe <garbeam@gmail.com>2008-02-11 20:48:22 +0000
commit4adfdc9d95b2ec6603deab153697e2296e3c9c97 (patch)
tree9a1bec9ea2b079ef0e2210a7e2834ceb40e0507f
parentc619363d1580d5913b00d8b7d0415da5917b8060 (diff)
downloaddwm-4adfdc9d95b2ec6603deab153697e2296e3c9c97.tar.gz
applied dme's patch to prevent changing prevtags if nothing actually changed
-rw-r--r--dwm.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/dwm.c b/dwm.c
index 699aed1..020adb3 100644
--- a/dwm.c
+++ b/dwm.c
@@ -1976,14 +1976,17 @@ xerrorstart(Display *dsply, XErrorEvent *ee) {
 void
 view(const char *arg) {
 	unsigned int i;
-
+	Bool tmp[LENGTH(tags)];
 	Monitor *m = &monitors[monitorat()];
 
-	memcpy(m->prevtags, m->seltags, sizeof initags);
 	for(i = 0; i < LENGTH(tags); i++)
-		m->seltags[i] = (NULL == arg);
-	m->seltags[idxoftag(arg)] = True;
-	arrange();
+		tmp[i] = (NULL == arg);
+	tmp[idxoftag(arg)] = True;
+	if(memcmp(m->seltags, tmp, sizeof initags) != 0) {
+		memcpy(m->prevtags, m->seltags, sizeof initags);
+		memcpy(m->seltags, tmp, sizeof initags);
+		arrange();
+	}
 }
 
 void
0' href='#n150'>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