summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTony Lainson <t.lainson@gmail.com>2015-11-10 14:54:16 +1100
committerMarkus Teich <markus.teich@stusta.mhn.de>2015-11-10 16:56:37 +0100
commit8b52c85dd1fb145b1012cd508ffd74465db7025a (patch)
tree3d56b196eda9840a91a54364685691fbda8f7eac
parent4ca44387e65a96a93b56ed1491f5f90c5e25d948 (diff)
downloadsent-8b52c85dd1fb145b1012cd508ffd74465db7025a.tar.gz
sent-8b52c85dd1fb145b1012cd508ffd74465db7025a.tar.bz2
sent-8b52c85dd1fb145b1012cd508ffd74465db7025a.zip
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.
-rw-r--r--sent.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/sent.c b/sent.c
index fb0b56e..50dee4c 100644
--- 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;
Software created with 💖