[PATCH:libXi] Initialize extension with the right number of events.

Peter Hutterer peter.hutterer at who-t.net
Wed Jan 6 21:40:28 PST 2010


On Wed, Jan 06, 2010 at 04:01:59PM +0100, Yann Droneaud wrote:
> Le mercredi 09 décembre 2009 à 14:06 +1000, Peter Hutterer a écrit :
> > If the server supports a lower XI version than the client, the Xlib-internal
> > event vector may be smashed. See libXext for more details.
> 
> > +    LockDisplay(dpy);
> > +    extversion = _XiGetExtensionVersionRequest(dpy, INAME,
> > +            codes.major_opcode);
> > +    if (!extversion || !extversion->present)
> > +        goto out;
> > +    UnlockDisplay(dpy);
> 
> In case of error, UnlockDisplay() is not called.

thanks, will amend.

> > +    SyncHandle();
> > +
> > +    if (extversion->major_version >= 2)
> > +        nevents = IEVENTS; /* number is fixed, XI2 adds GenericEvents only */
> > +    else if (extversion->major_version <= 0)
> > +    {
> > +        printf("XInput_find_display: invalid extension version %d.%d\n",
> > +                extversion->major_version, extversion->minor_version);
> 
> why not output this to stderr ?

it's for consistency, the rest of the extension simply printf's errors.

I'll send an updated version soon.
 
Cheers,
  Peter


More information about the xorg-devel mailing list