On Sat, Sep 6, 2008 at 10:35 AM, bill lam <[EMAIL PROTECTED]> 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.

Reply via email to