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

Yann Droneaud ydroneaud at mandriva.com
Wed Jan 6 07:01:59 PST 2010


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.

> +    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 ?


Regards.

-- 
Yann Droneaud





More information about the xorg-devel mailing list