simplified focusclient()
authorAnselm R. Garbe <arg@suckless.org>
Thu, 22 Feb 2007 17:51:34 +0100
changeset 831 8b84189854dc
parent 830 5a4fd8fec414
child 832 a634bea99a51
simplified focusclient()
layout.c
--- a/layout.c	Thu Feb 22 17:43:41 2007 +0100
+++ b/layout.c	Thu Feb 22 17:51:34 2007 +0100
@@ -75,21 +75,17 @@
    
 	if(!sel || !arg)
 		return;
-	switch(atoi(arg)) {
-	default:
-		return;
-	case 1:
-		for(c = sel->next; c && !isvisible(c); c = c->next);
-		if(!c)
-			for(c = clients; c && !isvisible(c); c = c->next);
-		break;
-	case -1:
+	if(atoi(arg) < 0) {
 		for(c = sel->prev; c && !isvisible(c); c = c->prev);
 		if(!c) {
 			for(c = clients; c && c->next; c = c->next);
 			for(; c && !isvisible(c); c = c->prev);
 		}
-		break;
+	}
+	else {
+		for(c = sel->next; c && !isvisible(c); c = c->next);
+		if(!c)
+			for(c = clients; c && !isvisible(c); c = c->next);
 	}
 	if(c) {
 		focus(c);