about summary refs log tree commit diff stats
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 */
 
 /* tag.c */
 extern void initrregs(void);			/* initialize regexps of rules defined in config.h */
-extern Client *getnext(Client *c);		/* returns next visible client */
-extern Client *getprev(Client *c);		/* returns previous visible client */
 extern void settags(Client *c, Client *trans);	/* sets tags of c */
 extern void tag(Arg *arg);			/* tags c with arg's index */
 extern 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;
 
 /* extern */
 
-Client *
-getnext(Client *c) {
-	for(; c && !isvisible(c); c = c->next);
-	return c;
-}
-
-Client *
-getprev(Client *c) {
-	for(; c && !isvisible(c); c = c->prev);
-	return c;
-}
-
 void
 initrregs(void) {
 	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 @@
 
 static Client *
 nexttiled(Client *c) {
-	for(c = getnext(c); c && c->isfloat; c = getnext(c->next));
+	for(; c && (c->isfloat || !isvisible(c)); c = c->next);
 	return c;
 }
 
@@ -125,8 +125,9 @@ focusnext(Arg *arg) {
    
 	if(!sel)
 		return;
-	if(!(c = getnext(sel->next)))
-		c = getnext(clients);
+	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);
 		restack();
@@ -139,9 +140,10 @@ focusprev(Arg *arg) {
 
 	if(!sel)
 		return;
-	if(!(c = getprev(sel->prev))) {
+	for(c = sel->prev; c && !isvisible(c); c = c->prev);
+	if(!c) {
 		for(c = clients; c && c->next; c = c->next);
-		c = getprev(c);
+		for(; c && !isvisible(c); c = c->prev);
 	}
 	if(c) {
 		focus(c);
3'>213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298