Changes to XInput Proto Number of Events Cause Xlib WireToEvent Vector Mismatch

Peter Hutterer peter.hutterer at
Wed Dec 2 19:44:59 PST 2009

On Wed, Dec 02, 2009 at 07:15:57PM -0800, Keith Packard wrote:
> On Thu, 26 Nov 2009 11:45:39 +1000, Peter Hutterer <peter.hutterer at> wrote:
> > On Wed, Nov 25, 2009 at 04:42:59PM -0500, Nathan Kidd wrote:
> > 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).
> Why can't the library know? Presumably it needs to support all of these
> extension versions, or it won't actually work at all (and should fail to
> initialize itself).
> Is it that the extension version isn't known at this point?
Pretty much, yes. For example, in libXrandr, the path is

XRRFindDisplay -> XextAddDisplay -> XInitExtension -> XQueryExtension
  libXrandr           libXext           libX11            libX11

XextAddDisplay gets the number of events passed in and it's hardcoded.
Now, you could probably get around that by changing XRRFindDisplay to issue
an XRRQueryVersion before XextAddDisplay and adjusting the number of events
based on the returned version. You'd need to patch this into every extension


More information about the xorg mailing list