diff options
author | Sebastian Rasmussen <sebras@gmail.com> | 2014-05-02 14:28:55 +0200 |
---|---|---|
committer | Sebastian Rasmussen <sebras@gmail.com> | 2014-05-02 14:34:32 +0200 |
commit | 7e9fd33a6648007692ef78e341ca8d19e312243f (patch) | |
tree | bdabb4c504b02923969db1c84a0aff5e2de915a2 /platform/x11 | |
parent | 9feb8a7000153ed33d93730c0900e1f4b257324e (diff) | |
download | mupdf-7e9fd33a6648007692ef78e341ca8d19e312243f.tar.xz |
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.
Diffstat (limited to 'platform/x11')
-rw-r--r-- | platform/x11/x11_main.c | 16 |
1 files changed, 5 insertions, 11 deletions
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) |