From 3cc2c50bb8422fc738a5875048c06758af6ded76 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Mon, 31 May 2010 09:39:56 +0200 Subject: major --thumbnails speed impromevents, new --thumb-redraw option See ChangeLog / man/feh.1 "--thumb-redraw" for more --- src/thumbnail.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/thumbnail.c') diff --git a/src/thumbnail.c b/src/thumbnail.c index fe36213..aa45688 100644 --- a/src/thumbnail.c +++ b/src/thumbnail.c @@ -71,6 +71,7 @@ void init_thumbnail_mode(void) int index_image_width, index_image_height; int x_offset_name = 0, x_offset_dim = 0, x_offset_size = 0; char *s; + unsigned int thumb_counter = 0; /* initialize thumbnail mode data */ td.im_main = NULL; @@ -350,11 +351,19 @@ void init_thumbnail_mode(void) last = l; } if (opt.display) { - winwidget_render_image(winwid, 0, 0); + /* thumb_counter is unsigned, so no need to catch overflows */ + if (++thumb_counter == opt.thumb_redraw) { + winwidget_render_image(winwid, 0, 0); + thumb_counter = 0; + } if (!feh_main_iteration(0)) exit(0); } } + + if (thumb_counter != 0) + winwidget_render_image(winwid, 0, 0); + if (opt.verbose) fprintf(stdout, "\n"); -- cgit v1.2.3