diff options
| -rw-r--r-- | dmenu.c | 10 |
1 files changed, 2 insertions, 8 deletions
| @@ -610,13 +610,12 @@ static void | |||
| 610 | setup(void) | 610 | setup(void) |
| 611 | { | 611 | { |
| 612 | int x, y, i, j; | 612 | int x, y, i, j; |
| 613 | unsigned int du, tmp; | 613 | unsigned int du; |
| 614 | XSetWindowAttributes swa; | 614 | XSetWindowAttributes swa; |
| 615 | XIM xim; | 615 | XIM xim; |
| 616 | Window w, dw, *dws; | 616 | Window w, dw, *dws; |
| 617 | XWindowAttributes wa; | 617 | XWindowAttributes wa; |
| 618 | XClassHint ch = {"dmenu", "dmenu"}; | 618 | XClassHint ch = {"dmenu", "dmenu"}; |
| 619 | struct item *item; | ||
| 620 | #ifdef XINERAMA | 619 | #ifdef XINERAMA |
| 621 | XineramaScreenInfo *info; | 620 | XineramaScreenInfo *info; |
| 622 | Window pw; | 621 | Window pw; |
| @@ -674,12 +673,7 @@ setup(void) | |||
| 674 | mw = wa.width; | 673 | mw = wa.width; |
| 675 | } | 674 | } |
| 676 | promptw = (prompt && *prompt) ? TEXTW(prompt) - lrpad / 4 : 0; | 675 | promptw = (prompt && *prompt) ? TEXTW(prompt) - lrpad / 4 : 0; |
| 677 | for (item = items; item && item->text; ++item) { | 676 | inputw = mw / 3; /* input width: ~30% of monitor width */ |
| 678 | if ((tmp = textw_clamp(item->text, mw/3)) > inputw) { | ||
| 679 | if ((inputw = tmp) == mw/3) | ||
| 680 | break; | ||
| 681 | } | ||
| 682 | } | ||
| 683 | match(); | 677 | match(); |
| 684 | 678 | ||
| 685 | /* create menu window */ | 679 | /* create menu window */ |
