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)
- add none sort_type HOT 2
- use stat for sorting by size like we do with mtime HOT 1
- use stat for sorting by size like we do with mtime HOT 1
- feh only zooms correctly in bspwm after modifying window HOT 1
- Feature request: Variable display times in slideshow mode HOT 2
- feh modifies a passed filelist HOT 4
- make appimage file or binary file
- Feh crashes with SIGBUS when rapidly changing the underliying file HOT 5
- --keep-zoom and preserving window geometry
- right click crash HOT 1
- feh does not open ppm files which use the P3 version
- Feh's signal handler is not async-signal-safe
- Add option to enable aliasing
- FEH problem -c HOT 2
- feh -c option not working HOT 1
- Heap-buffer-overflow when loading an image in imlib_load_image_with_error_return() HOT 5
- Double free in imlib_free_image_and_decache() HOT 2
- Free with invalid size in the function imlib_free_image_and_decache() HOT 2
- No handling of memory allocation of invalid size when calling init_imlib_fonts() HOT 2
- action not mapped? not called during feh session
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.