diff options
| author | Anselm R. Garbe <arg@suckless.org> | 2007-02-22 17:51:34 +0100 | 
|---|---|---|
| committer | Anselm R. Garbe <arg@suckless.org> | 2007-02-22 17:51:34 +0100 | 
| commit | 5a13632afb970ce78957f9f80c9d3a4e4b55d5d1 (patch) | |
| tree | ba33b0d7b6cc3ec49b8d269c8fd64537e207c974 | |
| parent | 587100873a66e34251041678504a8c1e28410591 (diff) | |
simplified focusclient()
| -rw-r--r-- | layout.c | 16 | 
1 files changed, 6 insertions, 10 deletions
| @@ -75,21 +75,17 @@ focusclient(const char *arg) {  	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); | 
