From 18dd1c5ea218c1b86e305d3ee0052335b1e22fc8 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Tue, 26 Mar 2019 17:19:39 +0100 Subject: Make SIGUSR1 / SIGUSR2 relaod the current image in single-file slideshows --- man/feh.pre | 10 +++++++--- src/signals.c | 13 +++++++++---- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/man/feh.pre b/man/feh.pre index 913b9b3..b1ef16a 100644 --- a/man/feh.pre +++ b/man/feh.pre @@ -1856,7 +1856,7 @@ So, to enlarge a specific part of an image, click the zoom button on that part. . .Sh SIGNALS . -In slideshow mode, +In slideshow and multiwindow mode, .Nm handles the following signals: . @@ -1864,11 +1864,15 @@ handles the following signals: . .It Dv SIGUSR1 . -Switch to next image +Slideshow mode: switch to next image; +reload current image if the slideshow consists of a single file. +Multiwindow mode: reload all images. . .It Dv SIGUSR2 . -Switch to previous image +Slideshow mode: switch to previous image; +reload current image if the slideshow consists of a single file. +Multiwindow mode: reload all images. . .El . 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); -- cgit v1.2.3