From 9bb42914a45161f9338ce05b4af0ad91c994c4ed Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Tue, 21 Feb 2012 01:19:29 -0600 Subject: also cache XftColorAllocName, for the same reason --- draw.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'draw.c') diff --git a/draw.c b/draw.c index f20ff45..7af1eb6 100644 --- a/draw.c +++ b/draw.c @@ -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, -- cgit v1.2.3-54-g00ecf