diff options
author | jasper <jasper> | 2007-06-05 19:03:20 +0000 |
---|---|---|
committer | jasper <jasper> | 2007-06-05 19:03:20 +0000 |
commit | c025dc90897fa7f96859e84b709443d70e8a2980 (patch) | |
tree | 91922c2a20c249e6501e5a37dbdeae4c2261d4f5 /client.c | |
parent | 15fdb76df90671c40afed1b95b7e2ee3a52aa1ce (diff) | |
download | cwm-c025dc90897fa7f96859e84b709443d70e8a2980.tar.gz cwm-c025dc90897fa7f96859e84b709443d70e8a2980.tar.xz cwm-c025dc90897fa7f96859e84b709443d70e8a2980.zip |
make it possible to cycle through the windows when non are selected.
(eg. when they're hidden, now you can cycle through them) from aon@iki.fi
Diffstat (limited to 'client.c')
-rw-r--r-- | client.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/client.c b/client.c index efaa925..54c8172 100644 --- a/client.c +++ b/client.c @@ -604,14 +604,23 @@ match: */ struct client_ctx * -client_cyclenext(struct client_ctx *cc, int reverse) +client_cyclenext(int reverse) { - struct screen_ctx *sc = CCTOSC(cc); + struct screen_ctx *sc; + struct client_ctx *cc; struct client_ctx *(*iter)(struct client_ctx *) = reverse ? &client_mruprev : &client_mrunext; /* TODO: maybe this should just be a CIRCLEQ. */ + if (!(cc = _curcc)) { + if (TAILQ_EMPTY(&Clientq)) + return(NULL); + cc = TAILQ_FIRST(&Clientq); + } + + sc = CCTOSC(cc); + /* if altheld; then reset the iterator to the beginning */ if (!sc->altpersist || sc->cycle_client == NULL) sc->cycle_client = TAILQ_FIRST(&sc->mruq); |