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 | |
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
-rw-r--r-- | draw.c | 13 | ||||
-rw-r--r-- | main.c | 52 |
2 files changed, 31 insertions, 34 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 : @@ -561,36 +561,28 @@ handle_xev(void) { if(ev.xbutton.window == dzen.slave_win.line[i]) dzen.slave_win.sel_line = i; } - /* - else if(ev.xbutton.window == dzen.sa_win) { - printf("Button press in sensitive area\n"); - fflush(stdout); - } - */ - else { - switch(ev.xbutton.button) { - case Button1: - do_action(button1); - break; - case Button2: - do_action(button2); - break; - case Button3: - do_action(button3); - break; - case Button4: - do_action(button4); - break; - case Button5: - do_action(button5); - break; - case Button6: - do_action(button6); - break; - case Button7: - do_action(button7); - break; - } + switch(ev.xbutton.button) { + case Button1: + do_action(button1); + break; + case Button2: + do_action(button2); + break; + case Button3: + do_action(button3); + break; + case Button4: + do_action(button4); + break; + case Button5: + do_action(button5); + break; + case Button6: + do_action(button6); + break; + case Button7: + do_action(button7); + break; } break; case KeyPress: |