[hackers] [PATCH] [sent] don't assume we get a ConfigureNotify event

From: Tony Lainson <t.lainson_AT_gmail.com>
Date: Tue, 10 Nov 2015 14:54:16 +1100

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 | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/sent.c b/sent.c
index 1b3b8f2..eac3b4a 100644
--- a/sent.c
+++ b/sent.c
_AT_@ -504,8 +504,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;
-- 
2.6.1
Received on Tue Nov 10 2015 - 04:54:16 CET

This archive was generated by hypermail 2.3.0 : Tue Nov 10 2015 - 05:00:15 CET