From 67af59cf866f9be06f8b51d6fac7572c3458f5ce Mon Sep 17 00:00:00 2001 From: Sebastian Rasmussen Date: Tue, 30 Jul 2013 12:26:51 +0200 Subject: Cancel page timeout when searching in x11 viewer. The scenario is that the user first displayed the page number (visible for two seconds) and then searched while the page number was still visible. The page number was automatically cleared when entering search text, but the timeout for clearing the page number was never cancelled. This caused an unnecessary redraw of the window while the search text was still being edited. --- platform/x11/x11_main.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'platform') diff --git a/platform/x11/x11_main.c b/platform/x11/x11_main.c index 4f825151..5de97187 100644 --- a/platform/x11/x11_main.c +++ b/platform/x11/x11_main.c @@ -715,6 +715,11 @@ static void onkey(int c) } pdfapp_onkey(&gapp, c); + + if (gapp.isediting) + { + showingpage = 0; + } } static void onmouse(int x, int y, int btn, int modifiers, int state) @@ -943,6 +948,11 @@ int main(int argc, char **argv) gettimeofday(&now, NULL); timeradd(&now, &tmo, &tmo_at); + } else if (!showingpage && (tmo_at.tv_sec || tmo_at.tv_usec)) + { + tmo_at.tv_sec = 0; + tmo_at.tv_usec = 0; + timeout = NULL; } if (XPending(xdpy) || transition_dirty) -- cgit v1.2.3