Comments (2)
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
.
from feh.
Yeah, that's the best solution. I prefer changing all function calls over building #define mazes, though ;-)
Fixed in 64e9c95
from feh.
Related Issues (20)
- Image Loads with Progressive Zoom
- feh no longer reading keys file HOT 1
- failure to load or scan directory HOT 1
- rotate 180 corrupts image
- Data loss with `--unloadable` deleting files HOT 1
- Feature request: logging or printing of current filename HOT 1
- EXIF data for HEIC pictures HOT 1
- feh should request Full Screen to the window manager HOT 2
- One-background-per-display does not work with nvidia drivers + modesetting enabled
- Fully opaque images with alpha channel are rendered slightly transparent when zoomed out HOT 3
- Screen rotation in fullscreen mode causes pictures to be drawn in tile pattern
- double free when using --randomize with unloadable image file
- Allow for adding/removing actions from menu
- CWE-476: NULL Pointer Dereference in XPM Image Parser (ImLib2) HOT 1
- man page site doesn't render HOT 1
- Feature request: Get last file path viewed when exiting feh HOT 1
- Feature request: slideshow for wallpapers
- [Feature Request] Slideshow - Add auto-pan to slideshow HOT 1
- [Feature Request] Slideshow - Add transitions to slideshow
- App icon is not shown: what am I doing wrong?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from feh.