Changes to XInput Proto Number of Events Cause Xlib WireToEvent Vector Mismatch
Nathan Kidd
nathan-svn at spicycrypto.ca
Thu Nov 26 10:43:25 PST 2009
Peter Hutterer wrote:
> On Wed, Nov 25, 2009 at 04:42:59PM -0500, Nathan Kidd wrote:
>> In the last few years inputproto's number of events (IEVENTS) has jumped
>> around quite a bit between 15 and 19, which has resulted in the
>> following issue I've recently became aware of:
>> ...
> AIUI, other extensions may be affected as well, not just
> Xi. Any newer library extension run against an older server (where the
> extension differs in the number of events) would suffer from this issue.
Correct; XInput just got noticed because it's had more development of
late. (The unfair rewards of all your work on Xi :) )
> Attached is an attempt of a fix to libXext. There's not a lot of
> wriggle-room, the APIs are quite restrictive and we can't pass a great deal
> of information around. Additionally, the library has no way of knowing how
> many events a given extension has, it's pure guesswork (or compiled into the
> library).
The reason not to just use the display's event_vec (attached patches,
your log message reused) is to avoid adding a libX11/libXext version
dependency?
Either approach fixes the WireToEvent case when considering events being
generated by the server, but I don't think there's anything that can be
done about the EventToWire (SendEvent request) case. Your choice is to
use the wrong EventToWire function for either the overlapping extension
events, or the following extension events. The former is preferred I
think since it will only break very new code (using new events).
Currently two unpatched clients could SendEvent new events (that xserver
didn't know about) successfully if they query extensions in the same
order. The patch will break them, but that's the only fallout I can
think of, and it seems necessary.
-Nathan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Add-XEGetWireToEvent.patch
Type: text/x-patch
Size: 1610 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg/attachments/20091126/d6376c8c/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Don-t-smash-the-event_vec-if-num_events-differs-betw.patch
Type: text/x-patch
Size: 2052 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg/attachments/20091126/d6376c8c/attachment-0001.bin>
More information about the xorg
mailing list