[hackers] [dwm] simplified focusclient()

From: Anselm R. Garbe <arg_AT_suckless.org>
Date: Thu Feb 22 17:55:04 2007

changeset: 831:8b84189854dc
user: Anselm R. Garbe <arg_AT_suckless.org>
date: Thu Feb 22 17:51:34 2007 +0100
summary: simplified focusclient()

diff -r 5a4fd8fec414 -r 8b84189854dc 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 @@ 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);
Received on Thu Feb 22 2007 - 17:55:04 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 15:55:44 UTC