[PATCH (v5) xinput 1/1] Add experimental multitouch support from XI 2.1
Cyril Brulebois
kibi at debian.org
Sun Jan 23 16:37:26 PST 2011
Hi Daniel,
Daniel Stone <daniel at fooishbar.org> (19/01/2011):
> +
> + if (event->evtype == XI_TouchBegin && event->event != event->child)
> + touch_events_received = 0;
> + else if (event->evtype == XI_TouchMotion && event->event != event->child &&
> + ++touch_events_received == 5)
> + XIAllowTouchEvents(event->display, event->sourceid, event->detail,
> + (thong ^= 1) ? XITouchOwnerAccept :
> + XITouchOwnerReject);
XIAllowTouchEvents is introduced in your libxi patch, so that needs
HAVE_XI2_1 ifdef around.
> }
>
> static void print_devicechangedevent(Display *dpy, XIDeviceChangedEvent *event)
> @@ -213,6 +241,16 @@ static void print_propertyevent(Display *display, XIPropertyEvent* event)
>
> XFree(name);
> }
> +
> +static void print_touchownershipevent(Display *display,
> + XITouchOwnershipEvent *event)
Ditto for XITouchOwnershipEvent.
> +{
> + printf(" device: %d (%d)\n", event->deviceid, event->sourceid);
> + printf(" touch id: %lx\n", event->touchid);
> + printf(" reason: %x\n", event->reason);
> + printf(" flags: %lx\n", event->flags);
> +}
[…]
> +#else
> + {
> + XIGrabModifiers mods = { XIAnyModifier, 0 };
> + mask.deviceid = XIAllMasterDevices;
> + memset(mask.mask, 0, mask.mask_len);
> + XISetMask(mask.mask, XI_TouchBegin);
> + XISetMask(mask.mask, XI_TouchMotion);
> + XISetMask(mask.mask, XI_TouchMotionUnowned);
> + XISetMask(mask.mask, XI_TouchOwnership);
> + XISetMask(mask.mask, XI_TouchEnd);
> + XIGrabTouchBegin(display, XIAllMasterDevices, win, False, &mask,
> + 1, &mods);
Ditto.
> + }
> +#endif
KiBi.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.x.org/archives/xorg-devel/attachments/20110124/9f55cc74/attachment.pgp>
More information about the xorg-devel
mailing list