diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2012-02-06 14:38:23 +0100 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2012-02-06 14:38:23 +0100 |
commit | 499c0e9b6d7a7ea537b90b33af2b3d655102a597 (patch) | |
tree | 4b08fb2101f173003cfb10305dc23ccd2289b0f0 /apps/x11_main.c | |
parent | 2c700c95c42671ef124ca85bf616115ae9f99259 (diff) | |
download | mupdf-499c0e9b6d7a7ea537b90b33af2b3d655102a597.tar.xz |
Fix 692841: Look at ConfigureNotify events while waiting for MapNotify.
We used to discard all events until we got a MapNotify, but some
window managers send the ConfigureNotify before the window is
mapped.
Diffstat (limited to 'apps/x11_main.c')
-rw-r--r-- | apps/x11_main.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/apps/x11_main.c b/apps/x11_main.c index 6815037a..f9b1dee1 100644 --- a/apps/x11_main.c +++ b/apps/x11_main.c @@ -254,7 +254,7 @@ void winhelp(pdfapp_t *app) void winresize(pdfapp_t *app, int w, int h) { XWindowChanges values; - int mask; + int mask, width, height; mask = CWWidth | CWHeight; values.width = w; @@ -268,6 +268,8 @@ void winresize(pdfapp_t *app, int w, int h) { gapp.winw = w; gapp.winh = h; + width = -1; + height = -1; XMapWindow(xdpy, xwin); XFlush(xdpy); @@ -275,6 +277,11 @@ void winresize(pdfapp_t *app, int w, int h) while (1) { XNextEvent(xdpy, &xevt); + if (xevt.type == ConfigureNotify) + { + width = xevt.xconfigure.width; + height = xevt.xconfigure.height; + } if (xevt.type == MapNotify) break; } @@ -283,6 +290,13 @@ void winresize(pdfapp_t *app, int w, int h) XFillRectangle(xdpy, xwin, xgc, 0, 0, gapp.image->w, gapp.image->h); XFlush(xdpy); + if (width != reqw || height != reqh) + { + gapp.shrinkwrap = 0; + dirty = 1; + pdfapp_onresize(&gapp, width, height); + } + mapped = 1; } } |