[PATCH v3 libXi] Handle new XIAllowEvent request size
Peter Hutterer
peter.hutterer at who-t.net
Wed Feb 8 23:37:27 PST 2012
On Wed, Feb 08, 2012 at 11:51:39PM +0100, Chase Douglas wrote:
> On 02/08/2012 10:58 PM, Peter Hutterer wrote:
> > On Wed, Feb 08, 2012 at 08:59:28AM -0800, Keith Packard wrote:
> >> <#part sign=pgpmime>
> >> On Wed, 8 Feb 2012 19:18:17 +1000, Peter Hutterer <peter.hutterer at who-t.net> wrote:
> >>
> >>> +/* for GetRequest() to work */
> >>> +#define X_XI2_2AllowEvents X_XIAllowEvents
> >>
> >> Should that be in the protocol header file?
> >
> > not really, this is just the opcode needed for libX11's GetReq() macro to
> > work. It expands the opcode based on the argument, the opcode for both the
> > old and the new version of the request is identical tough. Thus, IMO we
> > should not leak libXi implementation detail into the protocol.
>
> The problem is that anyone else outside of libxi (this is purely
> hypothetical, who would want to reimplement libxi?) would be unable to
> use GetReq* from libx11 without this kludge too. For those trying to
> follow the discussion, GetReq() is a macro that calls the GetReqSized()
> macro:
>
> #define GetReqSized(name, sz, req) \
> req = (x##name##Req *) _XGetRequest(dpy, X_##name, sz)
>
> Since the "name" parameter is defined by the versioned name of the
> request in your inputproto patch, it makes sense to me to ship the
> X_##name macro in inputproto too.
>
> I understand why you see this as a libxi kludge, but I think it's really
> a libx11 kludge. As such, the only way to fix it is to fix libx11 (hah)
> or to play by libx11's rules and define what it needs in the proto headers.
If someone wants to reimplement libXi based on libX11, I'm quite happy to make
their life harder than necessary (if that's even possible...)
Cheers,
Peter
More information about the xorg-devel
mailing list