Browse Source

applied dme's patch to prevent changing prevtags if nothing actually changed

Anselm R Garbe 17 years ago
parent
commit
4adfdc9d95
1 changed files with 8 additions and 5 deletions
  1. 8 5
      dwm.c

+ 8 - 5
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