client.c
changeset 875 73cd10af065a
parent 874 e42bdee29c92
child 877 29c4a4d1214c
--- a/client.c	Thu May 10 13:49:17 2007 +0200
+++ b/client.c	Mon May 14 11:54:30 2007 +0200
@@ -153,6 +153,14 @@
 }
 
 void
+focustopvisible(void) {
+	Client *c;
+
+	for(c = stack; c && !isvisible(c); c = c->snext);
+	focus(c);
+}
+
+void
 killclient(const char *arg) {
 	XEvent ev;
 
@@ -391,10 +399,8 @@
 	XConfigureWindow(dpy, c->win, CWBorderWidth, &wc); /* restore border */
 	detach(c);
 	detachstack(c);
-	if(sel == c) {
-		for(nc = stack; nc && !isvisible(nc); nc = nc->snext);
-		focus(nc);
-	}
+	if(sel == c)
+		focustopvisible();
 	XUngrabButton(dpy, AnyButton, AnyModifier, c->win);
 	setclientstate(c, WithdrawnState);
 	free(c->tags);