load all images before starting the preso
authorMarkus Teich <markus.teich@stusta.mhn.de>
Fri, 1 Sep 2017 23:09:36 +0000 (01:09 +0200)
committerMarkus Teich <markus.teich@stusta.mhn.de>
Fri, 1 Sep 2017 23:09:36 +0000 (01:09 +0200)
sent.c

diff --git a/sent.c b/sent.c
index 6a4d565956f0b425bbd8ff01e453cab5a94a5eda..6cf53ff6ae1924ecf2684ee74c00cd27cfe3a59d 100644 (file)
--- a/sent.c
+++ b/sent.c
@@ -436,12 +436,7 @@ advance(const Arg *arg)
                if (slides[idx].img)
                        slides[idx].img->state &= ~SCALED;
                idx = new_idx;
-               ffload(&slides[idx]);
                xdraw();
-               if (slidecount > idx + 1)
-                       ffload(&slides[idx + 1]);
-               if (0 < idx)
-                       ffload(&slides[idx - 1]);
        }
 }
 
@@ -533,6 +528,7 @@ void
 xinit()
 {
        XTextProperty prop;
+       unsigned int i;
 
        if (!(xw.dpy = XOpenDisplay(NULL)))
                die("sent: Unable to open display");
@@ -560,7 +556,8 @@ xinit()
        XSetWindowBackground(xw.dpy, xw.win, sc[ColBg].pixel);
 
        xloadfonts();
-       ffload(&slides[0]);
+       for (i = 0; i < slidecount; i++)
+               ffload(&slides[i]);
 
        XStringListToTextProperty(&argv0, 1, &prop);
        XSetWMName(xw.dpy, xw.win, &prop);