On 10/09/2012 11:49 PM, Peter Hutterer wrote:
> On Tue, Oct 09, 2012 at 08:31:12AM -0700, Chase Douglas wrote:
>> I think you're hitting an issue that just never was resolved properly.
>> I think that, ideally, when you perform a direct touch interaction and
>> the cursor moves to that location, any future relative device motion
>> should be performed relative to the new location.
>
> correct, that's the expected behaviour (and the behaviour for non-touch
> devices). Fix would be in dix/getevents.c:updateSlaveDeviceCoords() and
> figuring out why master->last.valuators apparently have the wrong values.

Thanks, that's good to know.  The issue is the storeLastValuators call
in GetTouchEvents.  The code was adapted from fill_pointer_events, which
it looks like was written under the assumption that the device is not a
master device.  Now GetTouchEvents does get called with dev being a
master device, which causes the problem.  I don't know if this should
happen or not, but in any case, skipping the storeLastValuators call for
master devices fixes this issue (see attached patch).

The next issue I encountered is harder to debug:  I somehow always end
up with a permanently active touch point that keeps getting replayed in
TouchEventHistoryReplay.  I'll look into that when I get a chance.

Tom
diff --git a/dix/getevents.c b/dix/getevents.c
index 71d83c4..03efd43 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -2001,9 +2001,17 @@ GetTouchEvents(InternalEvent *events, DeviceIntPtr dev, uint32_t ddx_touchid,
 
     clipValuators(dev, &mask);
 
-    if (emulate_pointer)
+    if (emulate_pointer && !IsMaster(dev))
         storeLastValuators(dev, &mask, 0, 1, devx, devy);
 
+    /* Update the MD's co-ordinates, which are always in desktop space. */
+    if (emulate_pointer && !IsMaster(dev) && !IsFloating(dev)) {
+	    DeviceIntPtr master = GetMaster(dev, MASTER_POINTER);
+
+	    master->last.valuators[0] = screenx;
+	    master->last.valuators[1] = screeny;
+    }
+
     event->root = scr->root->drawable.id;
 
     event_set_root_coordinates(event, screenx, screeny);
_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to