From 1a33244d367cfbc21d005c068f468ea18fd1b28b Mon Sep 17 00:00:00 2001 From: Sebastian Rasmussen Date: Sun, 4 Sep 2011 04:30:09 +0200 Subject: Coalesce consecutive X11 resize events into a single resize operation. --- apps/x11_main.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'apps/x11_main.c') 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) -- cgit v1.2.3