[PATCH 27/42] dix: add helper functions for adding/removing touch listeners

Chase Douglas chase.douglas at canonical.com
Mon Dec 19 19:20:38 PST 2011


On Dec 14, 2011, at 7:02 PM, Peter Hutterer <peter.hutterer at who-t.net> wrote:

[snip]

> +static void
> +TouchAddActiveGrabListener(DeviceIntPtr dev, TouchPointInfoPtr ti,
> +                           InternalEvent *ev, GrabPtr grab)
> +{
> +    if (!ti->emulate_pointer &&
> +        (grab->grabtype == CORE || grab->grabtype == XI))
> +        return;
> +
> +    if (!ti->emulate_pointer &&
> +        grab->grabtype == XI2 &&
> +        (grab->type != XI_TouchBegin && grab->type == XI_TouchEnd && grab->type == XI_TouchUpdate))
> +        return;
> +
> +    TouchAddGrabListener(dev, ti, ev, grab);

If I'm reading this right, we are adding the possibility of active grabs of touches. I didn't think that was part of the protocol.

> +}
> +
> +void
> +TouchSetupListeners(DeviceIntPtr dev, TouchPointInfoPtr ti, InternalEvent *ev)
> +{
> +    int i;
> +    SpritePtr sprite = &ti->sprite;
> +    WindowPtr win;
> +
> +    if (dev->deviceGrab.grab)
> +        TouchAddActiveGrabListener(dev, ti, ev, dev->deviceGrab.grab);

Non-touch active grabs do not allow for replaying events. Shouldn't we continue this policy and return if an active grab was found?

-- Chase


More information about the xorg-devel mailing list