Updating on this. I did some extra digging and it looks like the menu should be set to hold a max of 32 chars as that's the input limit. I re-adjusted my patch and now it takes the font width * 32 and uses that as the width measurement. With this I removed the custom size option and just allowed the caller to have it on or off by simply using a -w flag. I've checked with both fixed and variable width fonts and it looks to operate correctly although it does give extra space with variable width fonts as I believe the reported width is for the widest character in the font.
diff attached.
> Date: Sat, 17 Mar 2012 19:28:00 +0000
> Subject: Re: [dev] dmenu idea and diff, Ability to set menu width
> From: svartman95_AT_gmail.com
> To: dev_AT_suckless.org
>
> > I wasn't suggesting resizing it depending on the match, but resizing
> > it to the given font metrics for the longest item read from stdin
> > instead (only once at the start of dmenu).
> >
> Most simply, dmenu would be as wide as the screen.
>
Received on Thu Apr 19 2012 - 09:17:03 CEST