don't assume we get a ConfigureNotify event
authorTony Lainson <t.lainson@gmail.com>
Tue, 10 Nov 2015 03:54:16 +0000 (14:54 +1100)
committerMarkus Teich <markus.teich@stusta.mhn.de>
Tue, 10 Nov 2015 15:56:37 +0000 (16:56 +0100)
If the window manager maps our window at the requested size, we may not get a
ConfigureNotify event.  This happens e.g. under ratpoison.

The result is that xw.uw and xw.uh are never set, so text is too small and
pngscale() tries to divide by 0.

sent.c

diff --git a/sent.c b/sent.c
index fb0b56efb45547dea6e1ad6176658139dab38df4..50dee4cf056cff9357e76ecc6a0bf3fb8b872f4a 100644 (file)
--- a/sent.c
+++ b/sent.c
@@ -506,8 +506,7 @@ void xinit()
                die("Can't open display.");
        xw.scr = XDefaultScreen(xw.dpy);
        xw.vis = XDefaultVisual(xw.dpy, xw.scr);
-       xw.w = DisplayWidth(xw.dpy, xw.scr);
-       xw.h = DisplayHeight(xw.dpy, xw.scr);
+       resize(DisplayWidth(xw.dpy, xw.scr), DisplayHeight(xw.dpy, xw.scr));
 
        xw.attrs.background_pixel = WhitePixel(xw.dpy, xw.scr);
        xw.attrs.bit_gravity = CenterGravity;