diff options
author | gotmor <gotmor@f2baff5b-bf2c-0410-a398-912abdc3d8b2> | 2008-02-08 12:16:33 +0000 |
---|---|---|
committer | gotmor <gotmor@f2baff5b-bf2c-0410-a398-912abdc3d8b2> | 2008-02-08 12:16:33 +0000 |
commit | 5266fdda3e3625adf41377d2e0f32ec89a2b3de3 (patch) | |
tree | 765078692295a83a2f5c3780ba7b92708e83d001 /draw.c | |
parent | 30b4bd4ed1510654dbb0f6748977029f4a7a54ac (diff) | |
download | dzen-5266fdda3e3625adf41377d2e0f32ec89a2b3de3.tar.gz dzen-5266fdda3e3625adf41377d2e0f32ec89a2b3de3.zip |
fixed menu mode bug
added a check to determine if we use the pixmap buffer or not
git-svn-id: http://dzen.googlecode.com/svn/trunk@216 f2baff5b-bf2c-0410-a398-912abdc3d8b2
Diffstat (limited to 'draw.c')
-rw-r--r-- | draw.c | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -453,7 +453,7 @@ parse_line(const char *line, int lnr, int align, int reverse, int nodraw) { if(t != -1 && tval) { switch(t) { case icon: - if( (ip=search_icon_cache(tval)) != -1) { + if(MAX_ICON_CACHE && (ip=search_icon_cache(tval)) != -1) { XCopyArea(dzen.dpy, icons[ip].p, pm, dzen.tgc, 0, 0, icons[ip].w, icons[ip].h, px, set_posy ? py : (dzen.line_height >= (signed)icons[ip].h ? @@ -474,13 +474,16 @@ parse_line(const char *line, int lnr, int align, int reverse, int nodraw) { #ifdef DZEN_XPM else if(XpmReadFileToPixmap(dzen.dpy, dzen.title_win.win, tval, &xpm_pm, NULL, &xpma) == XpmSuccess) { setcolor(&pm, px, xpma.width, lastfg, lastbg, reverse, nobg); - cache_icon(tval, xpm_pm, xpma.width, xpma.height); + + if(MAX_ICON_CACHE) + cache_icon(tval, xpm_pm, xpma.width, xpma.height); XCopyArea(dzen.dpy, xpm_pm, pm, dzen.tgc, 0, 0, xpma.width, xpma.height, px, set_posy ? py : (dzen.line_height >= (signed)xpma.height ? (dzen.line_height - xpma.height)/2 : 0)); px += xpma.width; + /* freed by cache_icon() */ //XFreePixmap(dzen.dpy, xpm_pm); free_xpm_attrib = 1; } @@ -667,7 +670,7 @@ parse_line(const char *line, int lnr, int align, int reverse, int nodraw) { if(t != -1 && tval) { switch(t) { case icon: - if( (ip=search_icon_cache(tval)) != -1) { + if(MAX_ICON_CACHE && (ip=search_icon_cache(tval)) != -1) { XCopyArea(dzen.dpy, icons[ip].p, pm, dzen.tgc, 0, 0, icons[ip].w, icons[ip].h, px, set_posy ? py : (dzen.line_height >= (signed)icons[ip].h ? @@ -687,7 +690,9 @@ parse_line(const char *line, int lnr, int align, int reverse, int nodraw) { #ifdef DZEN_XPM else if(XpmReadFileToPixmap(dzen.dpy, dzen.title_win.win, tval, &xpm_pm, NULL, &xpma) == XpmSuccess) { setcolor(&pm, px, xpma.width, lastfg, lastbg, reverse, nobg); - cache_icon(tval, xpm_pm, xpma.width, xpma.height); + + if(MAX_ICON_CACHE) + cache_icon(tval, xpm_pm, xpma.width, xpma.height); XCopyArea(dzen.dpy, xpm_pm, pm, dzen.tgc, 0, 0, xpma.width, xpma.height, px, set_posy ? py : |