diff options
author | Sven Willner <sven.willner@gmail.com> | 2019-04-01 13:58:50 +0200 |
---|---|---|
committer | Sven Willner <sven.willner@gmail.com> | 2019-04-01 13:58:50 +0200 |
commit | a9ffd5d2234433bc3f3829713b0968a1d6c13b94 (patch) | |
tree | 78a78930edbf7c187e0803f367529f2aabc90627 /src/signals.c | |
parent | 1d3d1259590c8a600c3d800942ab5566802d3499 (diff) | |
parent | 18dd1c5ea218c1b86e305d3ee0052335b1e22fc8 (diff) |
Merge remote-tracking branch 'original/master'
Diffstat (limited to 'src/signals.c')
-rw-r--r-- | src/signals.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/signals.c b/src/signals.c index aeaf889..85d81bc 100644 --- a/src/signals.c +++ b/src/signals.c @@ -24,11 +24,12 @@ 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" void feh_handle_signal(int); -int sig_exit = 0; +volatile int sig_exit = 0; void setup_signal_handlers() { @@ -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); |