[PATCH libXi] Set the raw event's sourceid in XI 2.1 (#34240)

Peter Hutterer peter.hutterer at who-t.net
Sun Jul 31 20:25:36 PDT 2011


On Fri, Jul 29, 2011 at 10:54:34AM +0100, Daniel Stone wrote:
> On Fri, Jul 29, 2011 at 11:05:29AM +1000, Peter Hutterer wrote:
> > @@ -1636,7 +1636,12 @@ wireToRawEvent(xXIRawEvent *in, XGenericEventCookie *cookie)
> >      out->time           = in->time;
> >      out->detail         = in->detail;
> >      out->deviceid       = in->deviceid;
> > -    out->sourceid       = 0; /* https://bugs.freedesktop.org/show_bug.cgi?id=34240 */
> > +    /* https://bugs.freedesktop.org/show_bug.cgi?id=34240 */
> > +#if (defined XI_2_Major) && (defined XI_2_1_Minor)
> > +    out->sourceid       = in->sourceid;
> > +#else
> > +    out->sourceid       = 0;
> > +#endif
> >      out->flags          = in->flags;
> >  
> >      out->valuators.mask_len = in->valuators_len * 4;
> 
> This would probably be better as:
>     XExtDisplayInfo *info = XInput_find_display(cookie->display);
>     [...]
> #if defined(XI_2_Major) && defined(XI_2_1_Minor)
>     if (_XiCheckExtInit(dpy, XInput_2_1, info)
>         out->sourceid   = in->sourceid;
>     else
> #endif
>         out->sourceid   = 0;
> 
> With that:
> Reviewed-by: Daniel Stone <daniel at fooishbar.org>

good call, amended locally. thanks.

Cheers,
  Peter


More information about the xorg-devel mailing list