aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoroga2008-03-19 00:18:28 +0000
committeroga2008-03-19 00:18:28 +0000
commit7644f9dcec63b407725bbc5ab484870e1b8da794 (patch)
tree1de430b7c5840d2f3b7f41cbd12df095012ed275
parent51ec60ac51a9db833d03c08a0ab83c53993e222d (diff)
downloadcwm-7644f9dcec63b407725bbc5ab484870e1b8da794.tar.gz
As mentioned in my last commit, there was an issue where the switching
code would always assume that the number of windows to switch to was three if there were more windows hidden. Check for CLIENT_HIDDEN when we count. Now it counts correctly. ok simon@.
-rw-r--r--client.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/client.c b/client.c
index c01f11b..adbd3ab 100644
--- a/client.c
+++ b/client.c
@@ -15,7 +15,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
- * $Id: client.c,v 1.11 2008/01/16 11:39:20 oga Exp $
+ * $Id: client.c,v 1.12 2008/03/19 00:18:28 oga Exp $
*/
#include "headers.h"
@@ -642,17 +642,21 @@ client_cyclenext(int reverse)
void
client_cycleinfo(struct client_ctx *cc)
{
+#define LISTSIZE 3
int w, h, nlines, i, n, oneh, curn = -1, x, y, diff;
- struct client_ctx *ccc, *list[3];
+ struct client_ctx *ccc, *list[LISTSIZE];
struct screen_ctx *sc = CCTOSC(cc);
struct fontdesc *font = DefaultFont;
memset(list, 0, sizeof(list));
nlines = 0;
- TAILQ_FOREACH(ccc, &sc->mruq, mru_entry)
- nlines++;
- nlines = MIN(nlines, 3);
+ TAILQ_FOREACH(ccc, &sc->mruq, mru_entry) {
+ if (!ccc->flags & CLIENT_HIDDEN) {
+ if (++nlines == LISTSIZE)
+ break;
+ }
+ }
oneh = font_ascent(font) + font_descent(font) + 1;
h = nlines*oneh;