From 4fb686d6a6777950f0e0d55b848cd2af4cbad372 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 24 Jul 2013 11:50:00 +1000 Subject: dix: check the xi2mask, not the grab type for touch listeners grab->type is only non-zero for passive grabs. We're checking an active grab here, so we need to check if the touch mask is set on the grab. Test case: grab the device, then start two simultaneous touches. The grabbing client won't see the second touchpoints because grab->type is 0 and the second touch is not an emulating pointer. Signed-off-by: Peter Hutterer --- dix/touch.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'dix') diff --git a/dix/touch.c b/dix/touch.c index a4b6d7eea..a7ea213ba 100644 --- a/dix/touch.c +++ b/dix/touch.c @@ -895,8 +895,7 @@ TouchAddActiveGrabListener(DeviceIntPtr dev, TouchPointInfoPtr ti, if (!ti->emulate_pointer && grab->grabtype == XI2 && - (grab->type != XI_TouchBegin && grab->type != XI_TouchEnd && - grab->type != XI_TouchUpdate)) + !xi2mask_isset(grab->xi2mask, dev, XI_TouchBegin)) return; TouchAddGrabListener(dev, ti, ev, grab); -- cgit v1.2.3 From 3d8756631070c440cefa31b35fea3d407f187810 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Mon, 22 Jul 2013 13:43:07 +1000 Subject: dix: set the valuator mask to ensure XI 1.x events have data XI 1.x only allows for first + num valuators, so if a device sends data for valuators 0 and 2+ only (i.e. valuator 1 is missing) we still need to get the data for that from somewhere. XI 1.x uses the hack of an unset valuator mask to get the right coordinates, i.e. we set the value but don't set the mask for it so XI2 events have the right mask. For an absolute device in relative mode, this broke in b28a1af55cf, the value was now always 0. This wasn't visible on the cursor, only in an XI 1.x client. The GIMP e.g. sees jumps to x/0 every few events. Drop the condition introduced in b28a1af55cf, data in valuators is always absolute, regardless of the mode. Signed-off-by: Peter Hutterer --- dix/getevents.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'dix') diff --git a/dix/getevents.c b/dix/getevents.c index f5ab8c458..14b65cabc 100644 --- a/dix/getevents.c +++ b/dix/getevents.c @@ -239,7 +239,7 @@ set_valuators(DeviceIntPtr dev, DeviceEvent *event, ValuatorMask *mask) SetBit(event->valuators.mode, i); event->valuators.data[i] = valuator_mask_get_double(mask, i); } - else if (valuator_get_mode(dev, i) == Absolute) + else event->valuators.data[i] = dev->valuator->axisVal[i]; } } -- cgit v1.2.3