From 499c0e9b6d7a7ea537b90b33af2b3d655102a597 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Mon, 6 Feb 2012 14:38:23 +0100 Subject: 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. --- apps/x11_main.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'apps') 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; } } -- cgit v1.2.3