summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--dwm.h2
-rw-r--r--tag.c12
-rw-r--r--view.c12
3 files changed, 7 insertions, 19 deletions
diff --git a/dwm.h b/dwm.h
index 2969ecb..e92ad56 100644
--- a/dwm.h
+++ b/dwm.h
@@ -128,8 +128,6 @@ extern int xerror(Display *dsply, XErrorEvent *ee); /* dwm's X error handler */
128 128
129/* tag.c */ 129/* tag.c */
130extern void initrregs(void); /* initialize regexps of rules defined in config.h */ 130extern void initrregs(void); /* initialize regexps of rules defined in config.h */
131extern Client *getnext(Client *c); /* returns next visible client */
132extern Client *getprev(Client *c); /* returns previous visible client */
133extern void settags(Client *c, Client *trans); /* sets tags of c */ 131extern void settags(Client *c, Client *trans); /* sets tags of c */
134extern void tag(Arg *arg); /* tags c with arg's index */ 132extern void tag(Arg *arg); /* tags c with arg's index */
135extern void toggletag(Arg *arg); /* toggles c tags with arg's index */ 133extern void toggletag(Arg *arg); /* toggles c tags with arg's index */
diff --git a/tag.c b/tag.c
index f9aef0b..a6db1d5 100644
--- a/tag.c
+++ b/tag.c
@@ -31,18 +31,6 @@ static unsigned int len = 0;
31 31
32/* extern */ 32/* extern */
33 33
34Client *
35getnext(Client *c) {
36 for(; c && !isvisible(c); c = c->next);
37 return c;
38}
39
40Client *
41getprev(Client *c) {
42 for(; c && !isvisible(c); c = c->prev);
43 return c;
44}
45
46void 34void
47initrregs(void) { 35initrregs(void) {
48 unsigned int i; 36 unsigned int i;
diff --git a/view.c b/view.c
index 5c06027..6985dc7 100644
--- a/view.c
+++ b/view.c
@@ -8,7 +8,7 @@
8 8
9static Client * 9static Client *
10nexttiled(Client *c) { 10nexttiled(Client *c) {
11 for(c = getnext(c); c && c->isfloat; c = getnext(c->next)); 11 for(; c && (c->isfloat || !isvisible(c)); c = c->next);
12 return c; 12 return c;
13} 13}
14 14
@@ -125,8 +125,9 @@ focusnext(Arg *arg) {
125 125
126 if(!sel) 126 if(!sel)
127 return; 127 return;
128 if(!(c = getnext(sel->next))) 128 for(c = sel->next; c && !isvisible(c); c = c->next);
129 c = getnext(clients); 129 if(!c)
130 for(c = clients; c && !isvisible(c); c = c->next);
130 if(c) { 131 if(c) {
131 focus(c); 132 focus(c);
132 restack(); 133 restack();
@@ -139,9 +140,10 @@ focusprev(Arg *arg) {
139 140
140 if(!sel) 141 if(!sel)
141 return; 142 return;
142 if(!(c = getprev(sel->prev))) { 143 for(c = sel->prev; c && !isvisible(c); c = c->prev);
144 if(!c) {
143 for(c = clients; c && c->next; c = c->next); 145 for(c = clients; c && c->next; c = c->next);
144 c = getprev(c); 146 for(; c && !isvisible(c); c = c->prev);
145 } 147 }
146 if(c) { 148 if(c) {
147 focus(c); 149 focus(c);