don't allow resizing client beyond number of items
This commit is contained in:
parent
1f05283ce1
commit
ed682dca2d
|
@ -47,9 +47,15 @@ void
|
||||||
resizeclient(void)
|
resizeclient(void)
|
||||||
{
|
{
|
||||||
int omh = mh;
|
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);
|
bh = MAX(drw->font->h, drw->font->h + 2 + lineheight);
|
||||||
lines = MAX(lines, 0);
|
lines = MIN(itemCount, MAX(lines, 0));
|
||||||
reallines = lines;
|
reallines = lines;
|
||||||
|
|
||||||
#if USEIMAGE
|
#if USEIMAGE
|
||||||
|
|
Loading…
Reference in a new issue