aboutsummaryrefslogtreecommitdiffstats
path: root/draw.c
diff options
context:
space:
mode:
authorgotmor <gotmor@f2baff5b-bf2c-0410-a398-912abdc3d8b2>2008-02-08 12:16:33 +0000
committergotmor <gotmor@f2baff5b-bf2c-0410-a398-912abdc3d8b2>2008-02-08 12:16:33 +0000
commit5266fdda3e3625adf41377d2e0f32ec89a2b3de3 (patch)
tree765078692295a83a2f5c3780ba7b92708e83d001 /draw.c
parent30b4bd4ed1510654dbb0f6748977029f4a7a54ac (diff)
downloaddzen-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.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/draw.c b/draw.c
index 135c643..28a203a 100644
--- a/draw.c
+++ b/draw.c
@@ -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 :