diff options
author | Jesse Luehrs <doy@tozt.net> | 2012-02-21 01:19:29 -0600 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2012-02-21 01:32:59 -0600 |
commit | 9bb42914a45161f9338ce05b4af0ad91c994c4ed (patch) | |
tree | c4b93047b97b20ce32cd83fe32f93ae48a6e02da /draw.c | |
parent | 8e7f8c02a1c6f1a916376f43cbce1271225c2ec7 (diff) | |
download | dzen-9bb42914a45161f9338ce05b4af0ad91c994c4ed.tar.gz dzen-9bb42914a45161f9338ce05b4af0ad91c994c4ed.zip |
Diffstat (limited to 'draw.c')
-rw-r--r-- | draw.c | 14 |
1 files changed, 10 insertions, 4 deletions
@@ -806,11 +806,17 @@ parse_line(const char *line, int lnr, int align, int reverse, int nodraw) { XDrawString(dzen.dpy, pm, dzen.tgc, px, py+dzen.font.ascent, lbuf, strlen(lbuf)); #else if(reverse) { - XftColorAllocName(dzen.dpy, DefaultVisual(dzen.dpy, dzen.screen), - DefaultColormap(dzen.dpy, dzen.screen), xftcs_bg, &xftc); + if (!xftcolorcache_get(xftcs_bg, &xftc)) { + XftColorAllocName(dzen.dpy, DefaultVisual(dzen.dpy, dzen.screen), + DefaultColormap(dzen.dpy, dzen.screen), xftcs_bg, &xftc); + xftcolorcache_set(xftcs_bg, &xftc); + } } else { - XftColorAllocName(dzen.dpy, DefaultVisual(dzen.dpy, dzen.screen), - DefaultColormap(dzen.dpy, dzen.screen), xftcs, &xftc); + if (!xftcolorcache_get(xftcs, &xftc)) { + XftColorAllocName(dzen.dpy, DefaultVisual(dzen.dpy, dzen.screen), + DefaultColormap(dzen.dpy, dzen.screen), xftcs, &xftc); + xftcolorcache_set(xftcs, &xftc); + } } XftDrawStringUtf8(xftd, &xftc, |