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
>> <[email protected]> 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.
-- Chase
_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel