[Xcb] icccm

Jamey Sharp jamey at minilop.net
Sun Mar 20 02:21:53 PST 2005


On Sun, Mar 20, 2005 at 09:58:06AM +0100, Vincent Torri wrote:
> On Sun, 20 Mar 2005, Jamey Sharp wrote:
> > On Sun, Mar 20, 2005 at 12:57:26AM +0100, Vincent Torri wrote:
> > > Well, i've ported evas to xcb today and i have problems with the current
> > > icccm code:
> > > 1) i can't use SizeHintsFlags values, whereas i have to use them.
> >
> > I don't understand. Why do you have to use them?
> 
> I'm not comfortable with icccm, but here is a snapshot of what i use :
> 
>    szhints.flags = PMinSize | PMaxSize | PSize | USSize;
>    szhints.min_width = szhints.max_width = win_w;
>    szhints.min_height = szhints.max_height = win_h;
>    SetWMNormalHints(conn, win, &szhints);
> 
> is there another to do that ?

Yes, there is. In fact, if the code in icccm.c is correct, then the
above snippet is incorrect while looking reasonable, which is exactly
why I picked this design... I don't think you're allowed to set both
PSize and USSize at the same time, and I think if you specify either you
have to set the width and height fields of the size hints.

I intended this usage:

	SizeHints *szhints = AllocSizeHints();
	SizeHintsSetMinSize(szhints, win_w, win_h);
	SizeHintsSetMaxSize(szhints, win_w, win_h);
	SizeHintsSetSize(szhints, 0, win_w, win_h);
	SetWMNormalHints(conn, win, szhints);
	FreeSizeHints(szhints);

(The 0 parameter to the SetSize call is because I'm assuming your window
width and height are program-specified -- that is, the user-specified
flag is false. This will set flags to include PSize, but not USSize.)

On Sun, Mar 20, 2005 at 01:16:38AM -0800, Barton C Massey wrote:
> Assuming I understand the situation correctly, I'll comment
> that blind settings are almost always iffy.

Yeah, they are. :-)

> I thought you said in earlier e-mail you were planning to supply
> accessor functions?  Any reason Vincent shouldn't go ahead and do
> that?

Because that doesn't seem to be what he's trying to do. If it were, I'd
say he should go for it. I'd be willing to write them myself: it's a
couple dozen lines of code, counting blank lines and everything.

--Jamey


More information about the xcb mailing list