You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After deleting a file, feh will still count it when calculating the total shown in the next image. This is fixed by any action causing the image window to be re-rendered.
Like: "1 of 4" -> delete file -> "2 of 4" -> rerender -> "1 of 3"
The text was updated successfully, but these errors were encountered:
diff --git a/src/feh.h b/src/feh.h
index 63aeef6..6da9f5f 100644
--- a/src/feh.h+++ b/src/feh.h@@ -118,7 +118,9 @@ void init_unloadables_mode(void);
void feh_clean_exit(void);
int feh_load_image(Imlib_Image * im, feh_file * file);
void show_mini_usage(void);
-void slideshow_change_image(winwidget winwid, int change);+#define slideshow_change_image(winwid, change) \+ _slideshow_change_image(winwid, change, 1)+void _slideshow_change_image(winwidget winwid, int change, int render);
void slideshow_pause_toggle(winwidget w);
char *slideshow_create_name(feh_file * file);
void init_keyevents(void);
diff --git a/src/slideshow.c b/src/slideshow.c
index 6d39d2c..39ae81f 100644
--- a/src/slideshow.c+++ b/src/slideshow.c@@ -170,7 +170,7 @@ void feh_reload_image(winwidget w, int resize, int force_new)
return;
}
-void slideshow_change_image(winwidget winwid, int change)+void _slideshow_change_image(winwidget winwid, int change, int render)
{
int success = 0;
gib_list *last = NULL;
@@ -262,7 +262,8 @@ void slideshow_change_image(winwidget winwid, int change)
winwidget_reset_image(winwid);
winwid->im_w = gib_imlib_image_get_width(winwid->im);
winwid->im_h = gib_imlib_image_get_height(winwid->im);
- winwidget_render_image(winwid, 1, 0);+ if (render)+ winwidget_render_image(winwid, 1, 0);
s = slideshow_create_name(FEH_FILE(current_file->data));
winwidget_rename(winwid, s);
@@ -430,7 +431,7 @@ void feh_filelist_image_remove(winwidget winwid, char do_delete)
gib_list *doomed;
doomed = current_file;
- slideshow_change_image(winwid, SLIDE_NEXT);+ _slideshow_change_image(winwid, SLIDE_NEXT, 0);
if (do_delete)
filelist = feh_file_rm_and_free(filelist, doomed);
else
@@ -440,9 +441,7 @@ void feh_filelist_image_remove(winwidget winwid, char do_delete)
winwidget_destroy(winwid);
return;
}
- s = slideshow_create_name(FEH_FILE(winwid->file->data));- winwidget_rename(winwid, s);- free(s);+ winwidget_render_image(winwid, 1, 0);
} else if ((winwid->type == WIN_TYPE_SINGLE)
|| (winwid->type == WIN_TYPE_THUMBNAIL_VIEWER)) {
if (do_delete)
The cause is slideshow_change_image() is called before the image removed from the filelist and that function also makes call to render the image, so it still operates on soon-to-be-old filelist.
I am not sure if it's really need that function to assign a new current image before/after the current image removed. But that function seems to do some work, so I just added render and wrapped it up with a #define.
After deleting a file, feh will still count it when calculating the total shown in the next image. This is fixed by any action causing the image window to be re-rendered.
Like: "1 of 4" -> delete file -> "2 of 4" -> rerender -> "1 of 3"
The text was updated successfully, but these errors were encountered: