diff options
author | Sebastian Rasmussen <sebras@gmail.com> | 2013-07-30 12:26:51 +0200 |
---|---|---|
committer | Sebastian Rasmussen <sebras@gmail.com> | 2013-08-24 23:38:01 +0200 |
commit | 67af59cf866f9be06f8b51d6fac7572c3458f5ce (patch) | |
tree | 647d083d99caccc829fdfbb7e5a12b60932fa95c /platform | |
parent | 1d06fc68e8f3da0b639629b5af67e2fa682fcd30 (diff) | |
download | mupdf-67af59cf866f9be06f8b51d6fac7572c3458f5ce.tar.xz |
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.
Diffstat (limited to 'platform')
-rw-r--r-- | platform/x11/x11_main.c | 10 |
1 files changed, 10 insertions, 0 deletions
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) |