equal
deleted
inserted
replaced
73 focusclient(const char *arg) { |
73 focusclient(const char *arg) { |
74 Client *c; |
74 Client *c; |
75 |
75 |
76 if(!sel || !arg) |
76 if(!sel || !arg) |
77 return; |
77 return; |
78 switch(atoi(arg)) { |
78 if(atoi(arg) < 0) { |
79 default: |
|
80 return; |
|
81 case 1: |
|
82 for(c = sel->next; c && !isvisible(c); c = c->next); |
|
83 if(!c) |
|
84 for(c = clients; c && !isvisible(c); c = c->next); |
|
85 break; |
|
86 case -1: |
|
87 for(c = sel->prev; c && !isvisible(c); c = c->prev); |
79 for(c = sel->prev; c && !isvisible(c); c = c->prev); |
88 if(!c) { |
80 if(!c) { |
89 for(c = clients; c && c->next; c = c->next); |
81 for(c = clients; c && c->next; c = c->next); |
90 for(; c && !isvisible(c); c = c->prev); |
82 for(; c && !isvisible(c); c = c->prev); |
91 } |
83 } |
92 break; |
84 } |
|
85 else { |
|
86 for(c = sel->next; c && !isvisible(c); c = c->next); |
|
87 if(!c) |
|
88 for(c = clients; c && !isvisible(c); c = c->next); |
93 } |
89 } |
94 if(c) { |
90 if(c) { |
95 focus(c); |
91 focus(c); |
96 restack(); |
92 restack(); |
97 } |
93 } |