rynbrd / xf86-input-mtrack

Xorg Multitouch Trackpad Driver
GNU General Public License v2.0
355 stars 58 forks source link

Tap-to-drag results in extraneous button clicks #19

Open wixoff opened 13 years ago

wixoff commented 13 years ago

Tap-to-drag on an Apple Magic Trackpad using mtrack (0.2, Ubuntu Natty/11.04 x64, built from git master cloned on 2011-07-27) appears to result in extraneous button clicks.

When I tap to drag, I get a button1 click (press then release) immediately followed by a drag. This is what my finger does on the trackpad to initiate the drag (fast tap quickly followed by long press with drag), but nonetheless, this isn't correct/expected driver behavior. In Windows, OS X, and the xorg-input-synaptics driver, that first click is suppressed if a drag is initiated properly.

Bad things happen: if I try to tap-and-drag a window by its titlebar, it maximizes and won't drag. If I tap-and-drag to select text in a window, I get the first full word selected (the double-click) then, as I keep my finger down, dragging works as expected.

It's most easily observed using "xinput test [device]" where a drag looks like this:

$ xinput test 10
...
button press   1 
button release 1 
button press   1 
motion a[0]=731 a[1]=-1318 
motion a[0]=726 a[1]=-1289 
motion a[0]=721 a[1]=-1264 
motion a[0]=719 a[1]=-1233 
motion a[0]=717 a[1]=-1205 
motion a[0]=717 a[1]=-1179 
button release 1 
...

So the drag is working, but it has that extraneous button press-release first.

There are no timestaps on this, so it's hard to see what's really happening. So I recompiled mtrack with DEBUG_GESTURES defined and ran xev (which includes timestamps) at the same time. The linked files (via pastebin) xev.log and mtrack.log (excerpted from Xorg.0.log) show what happens there.

xev.log: http://pastebin.com/hrBfs1VC mtrack.log: http://pastebin.com/1njpNTQc

The linked xev.log and mtrack.log files show events from the same sequence of movement, so the timestamps can be correlated. The movements were:

Some pointer movement in the xev window (time=685082.775-685083.437) a tap-and-drag (time=685085.439-685086.351) More pointer movement (time=685088.702-685089.244) another tap-and-drag (time=685092.168-685093.270) More pointer movement (time=685094.935+)

I removed excess movement messages from the logs, leaving only a few in place around the button presses. I annotated the logs a little bit in square brackets, basically just to show where I removed excess movement messages and to delineate the separate movement sequences listed above.

Finally, below is a dump of "xinput list-props" on the trackpad device, so you can see the current property settings. I have tweaked some of the properties, but the same problem occurs at default settings.

Device 'Apple Wireless Trackpad':
    Device Enabled (117):  1
    Coordinate Transformation Matrix (119):  1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
    Device Accel Profile (242):  0
    Device Accel Constant Deceleration (243):  1.000000
    Device Accel Adaptive Deceleration (244):  1.000000
    Device Accel Velocity Scaling (245):  10.000000
    Trackpad Disable Input (268):  0
    Trackpad Sensitivity (269):  1.000000
    Trackpad Touch Pressure (270):  5, 5
    Trackpad Button Settings (271):  1, 1, 100, 0
    Trackpad Button Emulation (272):  3, 2, 0
    Trackpad Tap Settings (273):  50, 200, 400
    Trackpad Tap Button Emulation (274):  1, 3, 2, 0
    Trackpad Thumb Detection (275):  0, 0
    Trackpad Thumb Size (276):  25, 70
    Trackpad Palm Detection (277):  0, 0
    Trackpad Palm Size (278):  40
    Trackpad Gesture Settings (279):  10, 200
    Trackpad Scroll Distance (280):  100
    Trackpad Scroll Buttons (281):  4, 5, 6, 7
    Trackpad Swipe Distance (282):  500
    Trackpad Swipe Buttons (283):  9, 8, 10, 11
    Trackpad Swipe4 Distance (284):  700
    Trackpad Swipe4 Buttons (285):  0, 0, 0, 0
    Trackpad Scale Distance (286):  150
    Trackpad Scale Buttons (287):  14, 15
    Trackpad Rotate Distance (288):  150
    Trackpad Drag Settings (289):  1, 350, 40, 200
    Synaptics Locked Drags (448):  0
    Synaptics Tap FastTap (449):  0
    Synaptics Tap Time (450):  350
    Synaptics Tap Move (451):  350
    Synaptics Edge Scrolling (452):  0, 0, 0

(And maybe it's irrelevant, but why are the mtrack properties showing some synaptics entries? That's weird. There's no trace of synaptics in my Xorg.0.log. Huh.)

This is a great driver, and except for this problem (and the minor annoyance of the "sticky" upward scrolling, issue #18) it's just about perfect. I might submit a feature request or two, though . . .

rynbrd commented 12 years ago

Yes, admittedly the tap to drag functionality isn't perfect. It mostly works for me, but I haven't noticed the behavior you describe. It had to do with the tap to drag timings and their relationship to the other gesture timings. It's on my list of things to work out.

funnydevnull commented 12 years ago

I'm having the same issue...tap-to-drag just maximizes the window rather than dragging.

wixoff commented 12 years ago

I upgraded my installation to Ubuntu 12.04 x64 and installed the version of mtrack that's in the repositories (xserver-xorg-input-mtrack 0.2.0-2build2), and I can no longer reproduce this issue.

Previously, the issue I reported occurred when 0.2 was installed either from dpkg or from source. I can't explain why it works now.

rynbrd commented 12 years ago

That's unusual. I'll have to see if someone has submitted a patch for it in Ubuntu. Thanks for the heads up.

rcrath commented 12 years ago

I am having the exact problem cwixon describes in the first post on mint debian edition (based of testing) which uses mtrack 0.2.0-3, apple magic track pad. Changing "TapDragTime" changes the behavior, but lower than default (50=100) makes it so tap to drag never works and higher one (1000) lets me tap real slow to use it, but causes other problems. Want to try latest edition, but autoreconf gives an error. Since that is a separate issue I won't give the details here. otherwise the driver rocks. can't wait for coasting to be implemented