--- foo/dwm.c	2012-09-06 09:21:51.167059928 +0200
+++ src/dwm-6.0/dwm.c	2012-09-06 09:23:47.196434198 +0200
@@ -852,8 +852,10 @@
 			selmon = c->mon;
 		if(c->isurgent)
 			clearurgent(c);
-		detachstack(c);
-		attachstack(c);
+		if(c->tags != TAGMASK) {
+			detachstack(c);
+			attachstack(c);
+		}
 		grabbuttons(c, True);
 		XSetWindowBorder(dpy, c->win, dc.sel[ColBorder]);
 		setfocus(c);
