Re: [dev] Xft patch dwm 6.0

From: David Dufberg Töttrup <david_AT_dufberg.se>
Date: 16 May 2012 03:34:08 +0200

On May 15 2012, Lee Fallat wrote:
>There is one bug. For some reason, The colors for the font are affected by
>the previous color 'parsed' by XAllocNamedColor. If someone could check out
>getcolor() and figure what is wrong, that'd be great. I'd really like to
>make this patch *perfect* before throwing it up on suckless.
Don't know why you do the converting thingie. Why not use XftColorAllocName?
Like this (untested, but similar works in a program I wrote):
XftColor
getcolor(const char *colstr) {
    XftColor color;

    if(!XftColorAllocName(dpy, visual, cmap, colstr, &color))
        die("error, cannot allocate color '%s'\n", colstr);

    return color;
}


Also you don't need to XSetForeground before XftDrawStringUtf8 in drawtext.


David
Received on Wed May 16 2012 - 03:34:08 CEST

This archive was generated by hypermail 2.3.0 : Wed May 16 2012 - 03:36:15 CEST