summary refs log tree commit diff
diff options
context:
space:
mode:
authoroga <oga>2008-03-19 00:18:28 +0000
committeroga <oga>2008-03-19 00:18:28 +0000
commitfead0d511fef0f54cca29b3c4af68ab80289c117 (patch)
tree8f1a5f7376f93561fcd0fe0903d5f8b08fb6140d
parentf85ba10437bfc58fabf8ccd98a1a8db858651a48 (diff)
downloadcwm-fead0d511fef0f54cca29b3c4af68ab80289c117.tar.gz
cwm-fead0d511fef0f54cca29b3c4af68ab80289c117.tar.xz
cwm-fead0d511fef0f54cca29b3c4af68ab80289c117.zip
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.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/client.c b/client.c
index c40899a..51a2a8f 100644
--- a/client.c
+++ b/client.c
@@ -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;