From daa0d16221323c7a846816ca094576829d8e2ac7 Mon Sep 17 00:00:00 2001 From: QC Date: Sun, 13 Jul 2014 12:54:19 +0200 Subject: [PATCH] Make window width include the border width. --- source/rofi.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source/rofi.c b/source/rofi.c index 288557ad..36f20b9d 100644 --- a/source/rofi.c +++ b/source/rofi.c @@ -974,6 +974,9 @@ MenuReturn menu ( char **lines, char **input, char *prompt, Time *time, int *shi // Calculate as float to stop silly, big rounding down errors. int w = config.menu_width < 101 ? ( mon.w / 100.0f ) * ( float ) config.menu_width : config.menu_width; int x = mon.x + ( mon.w - w ) / 2; + // Compensate for border width. + w -= config.menu_bw*2; + int element_width = w - ( 2 * ( config.padding ) ); // Divide by the # columns element_width = ( element_width - ( columns - 1 ) * LINE_MARGIN ) / columns;