summaryrefslogtreecommitdiffstats
path: root/commands.c
diff options
context:
space:
mode:
authorBert Münnich <ber.t@posteo.de>2014-07-25 22:52:31 +0200
committerBert Münnich <ber.t@posteo.de>2014-07-25 22:52:31 +0200
commit5e481912ec983be89f10cbbb21561ed7cc898027 (patch)
tree8f009c6ccf4e884d570aaa72ba63c6c72693c128 /commands.c
parent9c92de858484b6bbe90252955bef5f77a80f3c45 (diff)
downloadnsxiv-5e481912ec983be89f10cbbb21561ed7cc898027.tar.zst
Revised handling of GIF animations
- New option `-a`: Play animations at startup - Ctrl-Space toggles animation for all GIF files - Infinite loop for all animations
Diffstat (limited to 'commands.c')
-rw-r--r--commands.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/commands.c b/commands.c
index cfcd1b1..41e59e8 100644
--- a/commands.c
+++ b/commands.c
@@ -282,13 +282,17 @@ bool ci_navigate_frame(arg_t a)
bool ci_toggle_animation(arg_t a)
{
+ bool dirty = false;
+
+ img.multi.animate = !img.multi.animate;
+
if (img.multi.animate) {
- reset_timeout(animate);
- img.multi.animate = false;
- } else if (img_frame_animate(&img, true)) {
+ dirty = img_frame_animate(&img, true);
set_timeout(animate, img.multi.frames[img.multi.sel].delay, true);
+ } else {
+ reset_timeout(animate);
}
- return true;
+ return dirty;
}
bool ci_scroll(arg_t a)