diff options
author | Sebastian Rasmussen <sebras@gmail.com> | 2011-09-04 04:30:09 +0200 |
---|---|---|
committer | Sebastian Rasmussen <sebras@gmail.com> | 2011-09-04 12:35:23 +0200 |
commit | 1a33244d367cfbc21d005c068f468ea18fd1b28b (patch) | |
tree | 43db8683128a154f8d214e73d9cc8c42ef7148f1 /apps | |
parent | f6b4b3586cef63c68cc3a436ffdf32edb8f144cf (diff) | |
download | mupdf-1a33244d367cfbc21d005c068f468ea18fd1b28b.tar.xz |
Coalesce consecutive X11 resize events into a single resize operation.
Diffstat (limited to 'apps')
-rw-r--r-- | apps/x11_main.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/apps/x11_main.c b/apps/x11_main.c index d62c63d6..2a42124b 100644 --- a/apps/x11_main.c +++ b/apps/x11_main.c @@ -543,6 +543,8 @@ int main(int argc, char **argv) int pageno = 1; int accelerate = 1; int fd; + int width = -1; + int height = -1; while ((c = fz_getopt(argc, argv, "p:r:b:A")) != -1) { @@ -606,9 +608,9 @@ int main(int argc, char **argv) xevt.xconfigure.height != reqh) gapp.shrinkwrap = 0; } - pdfapp_onresize(&gapp, - xevt.xconfigure.width, - xevt.xconfigure.height); + width = xevt.xconfigure.width; + height = xevt.xconfigure.height; + break; case KeyPress: @@ -683,6 +685,13 @@ int main(int argc, char **argv) if (closing) continue; + if (width != -1 || height != -1) + { + pdfapp_onresize(&gapp, width, height); + width = -1; + height = -1; + } + if (dirty || dirtysearch) { if (dirty) |