Re: [dwm] [dvtm]: fix for status bar

From: Marc Andre Tanner <mat_AT_brain-dump.org>
Date: Thu, 27 Nov 2008 00:29:50 +0100

On Tue, Nov 25, 2008 at 12:21:53AM +0100, Claudio M. Alessi wrote:
> On Thu, Nov 20, 2008 at 10:48:30PM +0100, Marc Andre Tanner wrote:
> > Problem is that strlen is used to calculate character width, which
> > doesn't work for utf8 therefore the statusbar content is not properly
> > aligned.
> I don't think i have the skills to fully solve the problem. I guess it
> would be useful a code like the following into the drawbar() function
> (replacing the strlen(3) call):
>
> l = mbstowcs(trash, stext, sizeof trash);
>
> This works properly with the right alignment but not with the left one.
>
> I'll RTFM and try to solve the problem, however if anyone is able to do
> the work it would be faster (better?) than me.

I also had to RTFM and as I am very tired right now I wouldn't be
surprised if there is a simpler way to accomplish it. Anyway attached is
a patch which seems to work for my limited test case. Please test,
review and post possible simplifications.

Thanks,
Marc

-- 
 Marc Andre Tanner >< http://www.brain-dump.org/ >< GPG key: CF7D56C0

Received on Wed Nov 26 2008 - 23:29:50 UTC

This archive was generated by hypermail 2.2.0 : Wed Nov 26 2008 - 23:36:04 UTC