From 7e9fd33a6648007692ef78e341ca8d19e312243f Mon Sep 17 00:00:00 2001 From: Sebastian Rasmussen Date: Fri, 2 May 2014 14:28:55 +0200 Subject: Initialize timeout earlier in x11 viewer Previously any warning displayed at the top of the page would never disappear because the display timeout being set would be overwritten by the later initialization. --- platform/x11/x11_main.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'platform/x11') diff --git a/platform/x11/x11_main.c b/platform/x11/x11_main.c index 58d0e2af..1d0f6b80 100644 --- a/platform/x11/x11_main.c +++ b/platform/x11/x11_main.c @@ -117,13 +117,7 @@ static void showmessage(pdfapp_t *app, int timeout, char *msg) fz_strlcpy(message, msg, sizeof message); - if (!tmo_at.tv_sec && !tmo_at.tv_usec) - { - tmo.tv_sec = timeout; - gettimeofday(&now, NULL); - timeradd(&now, &tmo, &tmo_at); - } - else if (tmo.tv_sec < timeout) + if ((!tmo_at.tv_sec && !tmo_at.tv_usec) || tmo.tv_sec < timeout) { tmo.tv_sec = timeout; tmo.tv_usec = 0; @@ -860,16 +854,16 @@ int main(int argc, char **argv) gapp.resolution = resolution; gapp.pageno = pageno; + tmo_at.tv_sec = 0; + tmo_at.tv_usec = 0; + timeout = NULL; + pdfapp_open(&gapp, filename, 0); FD_ZERO(&fds); signal(SIGHUP, signal_handler); - tmo_at.tv_sec = 0; - tmo_at.tv_usec = 0; - timeout = NULL; - while (!closing) { while (!closing && XPending(xdpy) && !transition_dirty) -- cgit v1.2.3