Re: [dwm] regression in 5.0.1

From: Brendan MacDonell <>
Date: Sat, 6 Sep 2008 12:00:25 -0400

On Sat, Sep 6, 2008 at 10:35 AM, bill lam <> wrote:
> I added that but have no idea where the error log resided.
> Nevertheless, I simplified that line to
> if(!XGetWMNormalHints(dpy, c->win, &size, &msize))return;
> and the issue is also fxied. My theory is that if XGetWMNormalHints
> fails then information returned in size is rubbish, and set that flag to
> PSize can help to prevent incorrectly change anything.

That is pretty much correct. According to the Xlib programming manual:
> If the property is of type WM_SIZE_HINTS, is of format 32, and is long enough to contain
> either an old (pre-ICCCM) or new size hints structure, XGetWMNormalHints() sets the
> various fields of the XSizeHints structure, sets the supplied_return argument to the list of
> fields that were supplied by the user (whether or not they contained defined values), and
> returns a nonzero status. Otherwise, it returns a zero status."

Ie., if a zero status is returned, then the variable size remains
uninitialized, and will contain whatever garbage was in that stack
segment when the function was called.
Received on Sat Sep 06 2008 - 16:00:25 UTC

This archive was generated by hypermail 2.2.0 : Sat Sep 06 2008 - 16:12:04 UTC