aboutsummaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
authorBert <ber.t@gmx.com>2011-02-16 23:03:42 +0100
committerBert <ber.t@gmx.com>2011-02-16 23:03:42 +0100
commite0d08920657e8e5132a732c2f429243efa899ac1 (patch)
tree12ff72420d8f2c07828099e27c8bc031ca8e7be8 /main.c
parent26c2179be7676df3049035e5e65039c7fc232cb7 (diff)
downloadnsxiv-e0d08920657e8e5132a732c2f429243efa899ac1.tar.zst
Use pthread to load thumbnails
Diffstat (limited to 'main.c')
-rw-r--r--main.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/main.c b/main.c
index 4d66595..2fccf7a 100644
--- a/main.c
+++ b/main.c
@@ -473,19 +473,22 @@ void run() {
timeout = 0;
while (1) {
- if (timeout) {
+ if (timeout || (mode == MODE_THUMBS && !tns.loaded)) {
t.tv_sec = 0;
t.tv_usec = 250;
xfd = ConnectionNumber(win.env.dpy);
FD_ZERO(&fds);
FD_SET(xfd, &fds);
-
+
if (!XPending(win.env.dpy) && !select(xfd + 1, &fds, 0, 0, &t)) {
timeout = 0;
if (mode == MODE_NORMAL)
img_render(&img, &win);
else
tns_render(&tns, &win);
+
+ if (mode == MODE_THUMBS && !tns.loaded && !XPending(win.env.dpy))
+ continue;
}
}