minor fix to view()
authorAnselm R Garbe <garbeam@gmail.com>
Wed, 02 Jul 2008 11:06:46 +0100
changeset 1304 ef3327d0517a
parent 1303 01064454b311
child 1305 027ae8f1bd1d
minor fix to view()
dwm.c
--- a/dwm.c	Tue Jul 01 19:26:17 2008 +0100
+++ b/dwm.c	Wed Jul 02 11:06:46 2008 +0100
@@ -94,6 +94,8 @@
 	Client *next;
 	Client *snext;
 	Window win;
+	void *aux;
+	void (*freeaux)(void *);
 };
 
 typedef struct {
@@ -1519,6 +1521,8 @@
 	detachstack(c);
 	if(sel == c)
 		focus(NULL);
+	if(c->aux && c->freeaux)
+		c->freeaux(c->aux);
 	XUngrabButton(dpy, AnyButton, AnyModifier, c->win);
 	setclientstate(c, WithdrawnState);
 	free(c);
@@ -1642,6 +1646,8 @@
 
 void
 view(const Arg *arg) {
+	if(arg && (arg->i & TAGMASK) == tagset[seltags])
+		return;
 	seltags ^= 1; /* toggle sel tagset */
 	if(arg && (arg->ui & TAGMASK))
 		tagset[seltags] = arg->i & TAGMASK;