From a4d8d49ad11b56ce89dea6f74f620192d4198dd9 Mon Sep 17 00:00:00 2001 From: Sebastian Rasmussen Date: Tue, 30 Jul 2013 14:20:21 +0200 Subject: X11 viewer code rearranged for aesthetic reasons. Set display timeout where the page number is shown, not in x11 main. --- platform/x11/x11_main.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'platform') diff --git a/platform/x11/x11_main.c b/platform/x11/x11_main.c index 84e85f2f..d74e9e15 100644 --- a/platform/x11/x11_main.c +++ b/platform/x11/x11_main.c @@ -741,6 +741,12 @@ static void onkey(int c) if (!gapp.isediting && c == 'P') { + struct timeval now; + struct timeval tmo; + tmo.tv_sec = 2; + tmo.tv_usec = 0; + gettimeofday(&now, NULL); + timeradd(&now, &tmo, &tmo_at); showingpage = 1; winrepaint(&gapp); return; @@ -973,14 +979,7 @@ int main(int argc, char **argv) pdfapp_postblit(&gapp); } - if (showingpage && !tmo_at.tv_sec && !tmo_at.tv_usec) - { - tmo.tv_sec = 2; - tmo.tv_usec = 0; - - gettimeofday(&now, NULL); - timeradd(&now, &tmo, &tmo_at); - } else if (!showingpage && !showingmessage && (tmo_at.tv_sec || tmo_at.tv_usec)) + if (!showingpage && !showingmessage && (tmo_at.tv_sec || tmo_at.tv_usec)) { tmo_at.tv_sec = 0; tmo_at.tv_usec = 0; -- cgit v1.2.3