summaryrefslogtreecommitdiff
path: root/platform/x11
diff options
context:
space:
mode:
Diffstat (limited to 'platform/x11')
-rw-r--r--platform/x11/x11_main.c16
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)