diff options
author | Levi Smith <lsmith3@unbc.ca> | 2010-09-04 03:58:43 -0700 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2010-09-05 16:25:35 +0200 |
commit | aa22a1466e747a67fbae482d0251545ebb73318f (patch) | |
tree | 8bed4fe2f0f22221a82844387a946bc88c7e16ec /src/winwidget.c | |
parent | c9787e8b1750a5f58ac759579e72a53ed752026d (diff) |
1) winwidget.c winwidget.h New function winwidget_update_caption using code in winwindget_render_image. This code was removed from the latter, and replaced with a call to winwidget_update_caption.
2) Image caption is updated after running action when in slideshow mode.
3) Running action in slideshow mode no longer changes the image automatically.
Diffstat (limited to 'src/winwidget.c')
-rw-r--r-- | src/winwidget.c | 41 |
1 files changed, 25 insertions, 16 deletions
diff --git a/src/winwidget.c b/src/winwidget.c index beae5df..e0862f8 100644 --- a/src/winwidget.c +++ b/src/winwidget.c @@ -306,6 +306,29 @@ void winwidget_update_title(winwidget ret) return; } +void winwidget_update_caption(winwidget winwid) +{ + if (opt.caption_path) { + /* TODO: Does someone understand the caching here. Is this the right + * approach now that I have broken this out into a separate function. -lsmith */ + + /* cache bg pixmap. during caption entry, multiple redraws are done + * because the caption overlay changes - the image doesn't though, so re- + * rendering that is a waste of time */ + if (winwid->caption_entry) { + GC gc; + if (winwid->bg_pmap_cache) + XFreePixmap(disp, winwid->bg_pmap_cache); + winwid->bg_pmap_cache = XCreatePixmap(disp, winwid->win, winwid->w, winwid->h, depth); + gc = XCreateGC(disp, winwid->win, 0, NULL); + XCopyArea(disp, winwid->bg_pmap, winwid->bg_pmap_cache, gc, 0, 0, winwid->w, winwid->h, 0, 0); + XFreeGC(disp, gc); + } + feh_draw_caption(winwid); + } + return; +} + void winwidget_setup_pixmaps(winwidget winwid) { if (winwid->full_screen) { @@ -506,22 +529,8 @@ void winwidget_render_image(winwidget winwid, int resize, int alias) sh, dx, dy, dw, dh, 1, gib_imlib_image_has_alpha(winwid->im), alias); - if (opt.caption_path) { - /* cache bg pixmap. during caption entry, multiple redraws are done - * because the caption overlay changes - the image doesn't though, so re- - * rendering that is a waste of time */ - if (winwid->caption_entry) { - GC gc; - if (winwid->bg_pmap_cache) - XFreePixmap(disp, winwid->bg_pmap_cache); - winwid->bg_pmap_cache = XCreatePixmap(disp, winwid->win, winwid->w, winwid->h, depth); - gc = XCreateGC(disp, winwid->win, 0, NULL); - XCopyArea(disp, winwid->bg_pmap, winwid->bg_pmap_cache, gc, 0, 0, winwid->w, winwid->h, 0, 0); - XFreeGC(disp, gc); - } - feh_draw_caption(winwid); - } - + if (opt.caption_path) + winwidget_update_caption(winwid); if (opt.draw_filename) feh_draw_filename(winwid); if (opt.draw_actions) |