[PATCH 1/3] fixesproto: Add a query to get the screen layout.

Keith Packard keithp at keithp.com
Tue Jul 28 22:41:02 PDT 2009


On Wed, 2009-07-29 at 15:19 +1000, Peter Hutterer wrote:

> I know that at least some of these combinations have been used in the
> xorg.conf for a while now and may be considered common knowledge but
> nonetheless it should be explicitly stated.

Right, the extension should describe all of the system constraints so
that we "know" how this works.


> Where do you get the number of screens from? IMO the request/reply should be
> consistent within itself, i.e. the reply should tell you how many layouts
> trail the reply (num_layouts or something). You can deduct that from the
> length field, but having it explicitly listed doesn't hurt.

Nope, we don't encode data twice in X -- if the length suffices, use it.

> What does screens resolve to? A pointer? or is it optimised away? This looks
> a bit awkward to me, the traditional approach is to leave the trailing data
> structures out of the structure. Removing the line should suffice, the
> protocol spec specifies what's trailing.

Correct.


> > +typedef struct {
> > +    CARD32  x B32;
> > +    CARD32  y B32;
> > +    CARD16  positionType B16;
> > +    CARD16  refScreen B16;
> > +} xXFixesScreenLayoutRec;
> > +
> 
> This struct is part of the protocol, not the client data. Should be moved to 
> xfixesproto.h (You can remove the Xmd.h include then too)

Right. The library needs its own structure which uses 'native' types for
each field (int for positions, unsigned int for positionType and
screen). The protocol header defines just the wire data, and shouldn't
be exposed to the client at all -- Xlib is supposed to wrap everything
(not that I really like this about Xlib, but...).

-- 
keith.packard at intel.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.x.org/archives/xorg-devel/attachments/20090728/3de0b26a/attachment.pgp 


More information about the xorg-devel mailing list