X-Git-Url: https://jasonwoof.com/gitweb/?p=dwm.git;a=blobdiff_plain;f=dwm.c;h=020adb3b10f303cfb8db4f31b1f10f6e24bf68c7;hp=699aed1d3e43a41d99076a077f803344af536024;hb=4adfdc9d95b2ec6603deab153697e2296e3c9c97;hpb=c619363d1580d5913b00d8b7d0415da5917b8060 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