|
|
|
@ -45,7 +45,8 @@
|
|
|
|
|
|
|
|
|
|
#define TV_DIFF(t1,t2) (((t1)->tv_sec - (t2)->tv_sec ) * 1000 + \
|
|
|
|
|
((t1)->tv_usec - (t2)->tv_usec) / 1000)
|
|
|
|
|
#define TV_ADD_MSEC(tv,t) do { \
|
|
|
|
|
#define TV_ADD_MSEC(tv, t) \
|
|
|
|
|
do { \
|
|
|
|
|
(tv)->tv_sec += (t) / 1000; \
|
|
|
|
|
(tv)->tv_usec += (t) % 1000 * 1000; \
|
|
|
|
|
} while (0)
|
|
|
|
@ -426,7 +427,8 @@ static void update_info(void)
|
|
|
|
|
/* update bar contents */
|
|
|
|
|
if (win.bar.h == 0 || extprefix)
|
|
|
|
|
return;
|
|
|
|
|
for (fw = 0, i = filecnt; i > 0; fw++, i /= 10);
|
|
|
|
|
for (fw = 0, i = filecnt; i > 0; fw++, i /= 10)
|
|
|
|
|
;
|
|
|
|
|
mark = files[fileidx].flags & FF_MARK ? "* " : "";
|
|
|
|
|
l->p = l->buf;
|
|
|
|
|
r->p = r->buf;
|
|
|
|
@ -454,7 +456,8 @@ static void update_info(void)
|
|
|
|
|
bar_put(r, "C%+d" BAR_SEP, img.contrast);
|
|
|
|
|
bar_put(r, "%3d%%" BAR_SEP, (int)(img.zoom * 100.0));
|
|
|
|
|
if (img.multi.cnt > 0) {
|
|
|
|
|
for (fn = 0, i = img.multi.cnt; i > 0; fn++, i /= 10);
|
|
|
|
|
for (fn = 0, i = img.multi.cnt; i > 0; fn++, i /= 10)
|
|
|
|
|
;
|
|
|
|
|
bar_put(r, "%0*d/%d" BAR_SEP, fn, img.multi.sel + 1, img.multi.cnt);
|
|
|
|
|
}
|
|
|
|
|
bar_put(r, "%0*d/%d", fw, fileidx + 1, filecnt);
|
|
|
|
@ -623,7 +626,8 @@ static bool run_key_handler(const char *key, unsigned int mask)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
fclose(pfs);
|
|
|
|
|
while (waitpid(pid, NULL, 0) == -1 && errno == EINTR);
|
|
|
|
|
while (waitpid(pid, NULL, 0) == -1 && errno == EINTR)
|
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
for (f = i = 0; f < fcnt; i++) {
|
|
|
|
|
if ((marked && (files[i].flags & FF_MARK)) || (!marked && i == fileidx)) {
|
|
|
|
@ -640,7 +644,8 @@ static bool run_key_handler(const char *key, unsigned int mask)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
/* drop user input events that occurred while running the key handler */
|
|
|
|
|
while (XCheckIfEvent(win.env.dpy, &dump, is_input_ev, NULL));
|
|
|
|
|
while (XCheckIfEvent(win.env.dpy, &dump, is_input_ev, NULL))
|
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
if (mode == MODE_IMAGE && changed) {
|
|
|
|
|
img_close(&img, true);
|
|
|
|
|