# HG changeset patch # User David Edmondson # Date 1201697367 0 # Node ID 5d3dd7a910209317156aef400c7875c71a1ffcbf # Parent 5cfd3c602edec1519568ebc7f8e443006c239b3b When switching viewed tags, don't update prevtags unless something actually changed. diff --git a/dwm.c b/dwm.c --- a/dwm.c +++ b/dwm.c @@ -1930,14 +1930,19 @@ void void view(const char *arg) { unsigned int i; + Bool tmp[LENGTH(tags)]; Monitor *m = &monitors[monitorat(-1, -1)]; - 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