summaryrefslogtreecommitdiff
path: root/slideshow/slideshow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'slideshow/slideshow.cpp')
-rw-r--r--slideshow/slideshow.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/slideshow/slideshow.cpp b/slideshow/slideshow.cpp
index d5b06ffc..86e3c1b6 100644
--- a/slideshow/slideshow.cpp
+++ b/slideshow/slideshow.cpp
@@ -118,13 +118,19 @@ int main(int argc, char **argv)
while (optind < argc - 1) {
draw(argv[optind++]);
- if (ev_wait(timeout) == 0) {
- ev_dispatch();
+ start = time(NULL);
+ long int timeout_remaining = timeout;
+ do {
+ if (ev_wait(timeout_remaining) == 0) {
+ ev_dispatch();
- if (key_code != -1) {
- input = true;
+ if (key_code != -1) {
+ input = true;
+ break;
+ }
}
- }
+ timeout_remaining -= (long int)(time(NULL) - start) * 1000;
+ } while (timeout_remaining > 0);
};
/* if there was user input while showing the images, display the last