Bug 55477 - DirectTouch pointer emulation issues
Summary: DirectTouch pointer emulation issues
Status: RESOLVED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Server/Input/Core (show other bugs)
Version: git
Hardware: Other All
: medium normal
Assignee: Peter Hutterer
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-30 22:00 UTC by Tom Jaeger
Modified: 2012-12-03 06:37 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
touch-update-master.diff (711 bytes, text/plain)
2012-09-30 22:00 UTC, Tom Jaeger
no flags Details
a single touch as captured by xinput test-xi2 2 (16.00 KB, text/plain)
2012-10-01 06:37 UTC, Tom Jaeger
no flags Details

Description Tom Jaeger 2012-09-30 22:00:33 UTC
Created attachment 67900 [details]
touch-update-master.diff

Hi Peter,

I've been playing around with my multi-touch capable wacom tablet pc and the evdev driver, and I've noticed a few problems.  They fall in two categories depending on (I think) whether the current application selects for touch events (e.g. gtk3 apps and xinput test-xi2 fall in the first category while gtk2 apps and xev fall in the second one).

For non touch-enabled applications (gtk2), the only problem I've noticed is that the master device is updated incorrectly: when I change to a relative device after touching a point (x,y) (in device coordinates) the cursor jumps to the point (x,y), now interpreted in screen coordinates.

For touch-enabled applications (gtk3), the master pointer is never updated, so the cursor jumps back to where it was before when switching to a relative device.  This is an easy enough fix (see attachment).  But there are deeper problems:  gtk3 applications seem generally confused by touch events (e.g. it's impossible to select an icon in nautilus by clicking on it), and even relative devices don't work right anymore after touches have happened (this can be fixed again by using an absolute device to update the master pointer.  Most of these issues can be fixed by commenting out the UpdateDeviceState in ProcessTouchEvent, so perhaps the problem originates in UpdateDeviceState, but I don't understand the input code all that well.  And of course it's possible that some of the blame rests on the toolkit.
Comment 1 Tom Jaeger 2012-10-01 06:37:24 UTC
Created attachment 67910 [details]
a single touch as captured by xinput test-xi2 2

I've attached a log of a single touch.  Right after the touch is done, the device switches back to the trackpoint (i guess that's fine), then there's a motion event with bogus coordinates, followed by a leave event.  I think the leave event is at least part of what's throwing applications off.  Weirdly enough, in a little gtk3.0 toy application I wrote, the leave event follows the first TouchEnd, but I don't see this behavior in xinput.
Comment 2 Tom Jaeger 2012-10-01 07:17:14 UTC
Scratch that, sorry, there can't possibly be anything wrong with a leave event after a touch sequence is over.
Comment 3 Peter Hutterer 2012-11-20 05:21:54 UTC
Patchset: http://lists.x.org/archives/xorg-devel/2012-October/034043.html
Comment 4 Peter Hutterer 2012-11-20 05:39:46 UTC
Patchset also fixes the jumping cursor issue pointed out in bug 49347 comment 14
Comment 5 Peter Hutterer 2012-12-03 06:37:55 UTC
commit 90b177e5cbb9047453af426d2abfe9c0514fe866
Author: Thomas Jaeger <ThJaeger@gmail.com>
Date:   Sat Oct 13 22:43:26 2012 -0400

    Update the MD's position when a touch event is received

commit cc79107a5b60d2926e16ddbee04149e8d5acc969
Author: Thomas Jaeger <ThJaeger@gmail.com>
Date:   Sat Oct 13 22:51:24 2012 -0400

    Don't use GetTouchEvents when replaying events

commit fe59774c55e5d423633405e0869c22f4ce382548
Author: Thomas Jaeger <ThJaeger@gmail.com>
Date:   Sat Oct 13 23:08:27 2012 -0400

    Don't use GetTouchEvents in EmitTouchEnd

commit d0fd592fc7be1706084923f43fa057e50122562c
Author: Thomas Jaeger <ThJaeger@gmail.com>
Date:   Sat Oct 13 23:18:50 2012 -0400

    Simplify GetTouchEvents


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.