From b986944d7a41589c542e02876fb834b355fccb4c Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Thu, 3 Jun 2010 17:18:40 -0400 Subject: [PATCH] Skip non-focusable windows on select up/down. --- cmd/wmii/column.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/cmd/wmii/column.c b/cmd/wmii/column.c index 7517b8c4..383e10b4 100644 --- a/cmd/wmii/column.c +++ b/cmd/wmii/column.c @@ -192,29 +192,31 @@ Frame* stack_find(Area *a, Frame *f, int dir, bool stack) { Frame *fp; +#define predicate(f) !((f)->collapsed && stack || (f)->client->nofocus) switch (dir) { default: die("not reached"); case North: if(f) - for(f=f->aprev; f && f->collapsed && stack; f=f->aprev) + for(f=f->aprev; f && !predicate(f); f=f->aprev) ; else { f = nil; for(fp=a->frame; fp; fp=fp->anext) - if(!fp->collapsed || !stack) + if(predicate(fp)) f = fp; } break; case South: if(f) - for(f=f->anext; f && f->collapsed && stack; f=f->anext) + for(f=f->anext; f && !predicate(f); f=f->anext) ; else - for(f=a->frame; f && f->collapsed && stack; f=f->anext) + for(f=a->frame; f && !predicate(f); f=f->anext) ; break; } +#undef predicate return f; }