don't assume we get a ConfigureNotify event

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.
This commit is contained in:
Tony Lainson 2015-11-10 14:54:16 +11:00 committed by Markus Teich
parent 4ca44387e6
commit 8b52c85dd1

3
sent.c
View File

@ -506,8 +506,7 @@ void xinit()
die("Can't open display."); die("Can't open display.");
xw.scr = XDefaultScreen(xw.dpy); xw.scr = XDefaultScreen(xw.dpy);
xw.vis = XDefaultVisual(xw.dpy, xw.scr); xw.vis = XDefaultVisual(xw.dpy, xw.scr);
xw.w = DisplayWidth(xw.dpy, xw.scr); resize(DisplayWidth(xw.dpy, xw.scr), DisplayHeight(xw.dpy, xw.scr));
xw.h = DisplayHeight(xw.dpy, xw.scr);
xw.attrs.background_pixel = WhitePixel(xw.dpy, xw.scr); xw.attrs.background_pixel = WhitePixel(xw.dpy, xw.scr);
xw.attrs.bit_gravity = CenterGravity; xw.attrs.bit_gravity = CenterGravity;