summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2019-03-26 17:19:39 +0100
committerDaniel Friesel <derf@finalrewind.org>2019-03-26 17:19:39 +0100
commit18dd1c5ea218c1b86e305d3ee0052335b1e22fc8 (patch)
tree6222cbc221c81753fc6adfca41db999f45e5ff5f /src
parente40399f4cd63fd55f38733ef698b8833bd6f9f61 (diff)
Make SIGUSR1 / SIGUSR2 relaod the current image in single-file slideshows
Diffstat (limited to 'src')
-rw-r--r--src/signals.c13
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);