diff options
author | Daniel Friesel <derf@finalrewind.org> | 2019-03-26 17:19:39 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2019-03-26 17:19:39 +0100 |
commit | 18dd1c5ea218c1b86e305d3ee0052335b1e22fc8 (patch) | |
tree | 6222cbc221c81753fc6adfca41db999f45e5ff5f /src | |
parent | e40399f4cd63fd55f38733ef698b8833bd6f9f61 (diff) |
Make SIGUSR1 / SIGUSR2 relaod the current image in single-file slideshows
Diffstat (limited to 'src')
-rw-r--r-- | src/signals.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/signals.c b/src/signals.c index d65f49b..85d81bc 100644 --- a/src/signals.c +++ b/src/signals.c @@ -24,6 +24,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "feh.h" +#include "filelist.h" #include "winwidget.h" #include "options.h" @@ -94,10 +95,14 @@ void feh_handle_signal(int signo) winwid = winwidget_get_first_window_of_type(WIN_TYPE_SLIDESHOW); if (winwid) { - if (signo == SIGUSR1) - slideshow_change_image(winwid, SLIDE_NEXT, 1); - else if (signo == SIGUSR2) - slideshow_change_image(winwid, SLIDE_PREV, 1); + if (filelist_len > 1) { + if (signo == SIGUSR1) + slideshow_change_image(winwid, SLIDE_NEXT, 1); + else if (signo == SIGUSR2) + slideshow_change_image(winwid, SLIDE_PREV, 1); + } else { + feh_reload_image(winwid, 0, 0); + } } else if (opt.multiwindow) { for (i = window_num - 1; i >= 0; i--) feh_reload_image(windows[i], 0, 0); |