diff --git a/libs/client.c b/libs/client.c index 6c17d7a..bd3f0ce 100644 --- a/libs/client.c +++ b/libs/client.c @@ -47,9 +47,15 @@ void resizeclient(void) { int omh = mh; + struct item *item; + int itemCount = 0; + + // walk through all items + for (item = items; item && item->text; item++) + itemCount++; bh = MAX(drw->font->h, drw->font->h + 2 + lineheight); - lines = MAX(lines, 0); + lines = MIN(itemCount, MAX(lines, 0)); reallines = lines; #if USEIMAGE