diff options
author | jasper | 2007-06-05 19:03:20 +0000 |
---|---|---|
committer | jasper | 2007-06-05 19:03:20 +0000 |
commit | 044c0fe02de73847e6f7539431b3c4b95966be51 (patch) | |
tree | 89ed3c012e6e2d1a5073703b591cebf83a6aa951 /client.c | |
parent | e594623ee759089fcbce526363231e802423def0 (diff) | |
download | cwm-044c0fe02de73847e6f7539431b3c4b95966be51.tar.gz |
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 | 15 |
1 files changed, 12 insertions, 3 deletions
@@ -4,7 +4,7 @@ * Copyright (c) 2004 Marius Aamodt Eriksen <marius@monkey.org> * All rights reserved. * - * $Id: client.c,v 1.4 2007/05/29 22:38:44 jasper Exp $ + * $Id: client.c,v 1.5 2007/06/05 19:03:20 jasper Exp $ */ #include "headers.h" @@ -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); |