[hackers] [sent] don't assume we get a ConfigureNotify event || Tony Lainson

From: <git_AT_suckless.org>
Date: Tue, 10 Nov 2015 16:58:21 +0100 (CET)

commit 8b52c85dd1fb145b1012cd508ffd74465db7025a
Author: Tony Lainson <t.lainson_AT_gmail.com>
AuthorDate: Tue Nov 10 14:54:16 2015 +1100
Commit: Markus Teich <markus.teich_AT_stusta.mhn.de>
CommitDate: Tue Nov 10 16:56:37 2015 +0100

    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.

diff --git a/sent.c b/sent.c
index fb0b56e..50dee4c 100644
--- a/sent.c
+++ b/sent.c
_AT_@ -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;
Received on Tue Nov 10 2015 - 16:58:21 CET

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