applied dme's patch to prevent changing prevtags if nothing actually changed
authorAnselm R Garbe <garbeam@gmail.com>
Mon, 11 Feb 2008 20:48:22 +0000
changeset 1082 3a617d40e320
parent 1081 2345b08ec46b
child 1083 f07dd2c127c1
applied dme's patch to prevent changing prevtags if nothing actually changed
dwm.c
--- a/dwm.c	Mon Feb 11 20:43:41 2008 +0000
+++ b/dwm.c	Mon Feb 11 20:48:22 2008 +0000
@@ -1976,14 +1976,17 @@
 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