applied dme's patch to prevent changing prevtags if nothing actually changed 4adfdc9d
Anselm R Garbe · 2008-02-11 20:48 1 file(s) · +8 −5
dwm.c +8 −5
1976 1976
void
1977 1977
view(const char *arg) {
1978 1978
	unsigned int i;
1979 -
1979 +
	Bool tmp[LENGTH(tags)];
1980 1980
	Monitor *m = &monitors[monitorat()];
1981 1981
1982 -
	memcpy(m->prevtags, m->seltags, sizeof initags);
1983 1982
	for(i = 0; i < LENGTH(tags); i++)
1984 -
		m->seltags[i] = (NULL == arg);
1985 -
	m->seltags[idxoftag(arg)] = True;
1986 -
	arrange();
1983 +
		tmp[i] = (NULL == arg);
1984 +
	tmp[idxoftag(arg)] = True;
1985 +
	if(memcmp(m->seltags, tmp, sizeof initags) != 0) {
1986 +
		memcpy(m->prevtags, m->seltags, sizeof initags);
1987 +
		memcpy(m->seltags, tmp, sizeof initags);
1988 +
		arrange();
1989 +
	}
1987 1990
}
1988 1991
1989 1992
void