[PATCH 40/42] dix: Remove touch grabs if the grab disappears

Peter Hutterer peter.hutterer at who-t.net
Thu Dec 15 16:50:48 PST 2011


On Thu, Dec 15, 2011 at 03:41:39PM -0200, Fernando Carrijo wrote:
> Peter Hutterer <peter.hutterer at who-t.net> wrote:
> 
> > +void
> > +TouchListenerGone(XID resource)
> > +{
> > +    TouchPointInfoPtr ti;
> > +    DeviceIntPtr dev;
> > +    InternalEvent *events = InitEventList(GetMaximumEventsNum());
> 
> Forgot to deallocate the event list.
> 
> > +    int i, j, k, nev;
> > +
> > +    if (!events)
> > +        FatalError("TouchListenerGone: couldn't allocate events\n");
> > +
> > +    for (dev = inputInfo.devices; dev; dev = dev->next)
> > +    {
> > +        if (!dev->touch)
> > +            continue;
> > +
> > +        for (i = 0; i < dev->touch->num_touches; i++)
> > +        {
> > +            ti = &dev->touch->touches[i];
> > +            if (!ti->active)
> > +                continue;
> > +
> > +            for (j = 0; j < ti->num_listeners; j++)
> > +            {
> > +                if (ti->listeners[j].listener != resource)
> > +                    continue;
> > +
> > +                nev = GetTouchOwnershipEvents(events, dev, ti, XIRejectTouch,
> > +                                              resource, 0);
> > +                for (k = 0; k < nev; k++)
> > +                    mieqProcessDeviceEvent(dev, events + k, NULL);
> > +
> > +                break;
> > +            }
> > +        }
> > +    }


FreeEventList(events, GetMaximumEventsNum());

added here, thanks.

Cheers,
  Peter


More information about the xorg-devel mailing list