Bug 93504 - Reduce/remove two-finger scrolling threshold
Summary: Reduce/remove two-finger scrolling threshold
Status: RESOLVED FIXED
Alias: None
Product: Wayland
Classification: Unclassified
Component: libinput (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Wayland bug list
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 93503
Blocks:
  Show dependency treegraph
 
Reported: 2015-12-25 16:54 UTC by Cyril B.
Modified: 2016-08-30 06:49 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments
3 normal scrolls (50.65 KB, text/plain)
2016-02-09 09:45 UTC, Cyril B.
Details
0001-touchpad-if-the-second-finger-is-within-20x5mm-bias-.patch (1.97 KB, patch)
2016-02-11 01:46 UTC, Peter Hutterer
Details | Splinter Review

Description Cyril B. 2015-12-25 16:54:15 UTC
I've read http://comments.gmane.org/gmane.comp.freedesktop.wayland.devel/24976 regarding this issue. As far as I'm concerned, I find the threshold annoying, and I've overridden tp->device->scroll.treshold to 0.

Under OSX, there's no scrolling threshold (or low enough that I can't notice it), and the pinch gesture seems to be working fine. Aren't both gestures different enough not to require a threshold?
Comment 1 Peter Hutterer 2016-01-05 04:45:05 UTC
Please run the touchpad-edge-detector tool an post the output here, together with the output of sudo evemu-describe for the touchpad device.
Comment 2 Cyril B. 2016-01-08 16:46:15 UTC
# touchpad-edge-detector /dev/input/event9
Touchpad DLL0704:01 06CB:76AD Touchpad on /dev/input/event9
Move one finger around the touchpad to detect the actual edges
Kernel says:    x [0..1216], y [0..680]
Touchpad sends: x [0..1216], y [0..680] |\-\
^C

Touchpad size as listed by the kernel: 101x56mm
Calculate resolution as:
        x axis: 1216/<width in mm>
        y axis: 680/<height in mm>

Suggested udev rule:
# <Laptop model description goes here>
evdev:name:DLL0704:01 06CB:76AD Touchpad:dmi:bvnDellInc.:bvr1.1.7:bd11/27/2015:svnDellInc.:pnXPS139350:pvr:rvnDellInc.:rn07TYC2:rvrA01:cvnDellInc.:ct9:cvr:*
 EVDEV_ABS_00=0:1216:<x resolution>
 EVDEV_ABS_01=0:680:<y resolution>
 EVDEV_ABS_35=0:1216:<x resolution>
 EVDEV_ABS_36=0:680:<y resolution>

# evemu-describe /dev/input/event9
# EVEMU 1.3
# Kernel: 4.4.0-1-ARCH
# DMI: dmi:bvnDellInc.:bvr1.1.7:bd11/27/2015:svnDellInc.:pnXPS139350:pvr:rvnDellInc.:rn07TYC2:rvrA01:cvnDellInc.:ct9:cvr:
# Input device name: "DLL0704:01 06CB:76AD Touchpad"
# Input device ID: bus 0x18 vendor 0x6cb product 0x76ad version 0x100
# Supported events:
#   Event type 0 (EV_SYN)
#     Event code 0 (SYN_REPORT)
#     Event code 1 (SYN_CONFIG)
#     Event code 2 (SYN_MT_REPORT)
#     Event code 3 (SYN_DROPPED)
#     Event code 4 ((null))
#     Event code 5 ((null))
#     Event code 6 ((null))
#     Event code 7 ((null))
#     Event code 8 ((null))
#     Event code 9 ((null))
#     Event code 10 ((null))
#     Event code 11 ((null))
#     Event code 12 ((null))
#     Event code 13 ((null))
#     Event code 14 ((null))
#   Event type 1 (EV_KEY)
#     Event code 272 (BTN_LEFT)
#     Event code 325 (BTN_TOOL_FINGER)
#     Event code 330 (BTN_TOUCH)
#     Event code 333 (BTN_TOOL_DOUBLETAP)
#     Event code 334 (BTN_TOOL_TRIPLETAP)
#   Event type 3 (EV_ABS)
#     Event code 0 (ABS_X)
#       Value    991
#       Min        0
#       Max     1216
#       Fuzz       0
#       Flat       0
#       Resolution 12
#     Event code 1 (ABS_Y)
#       Value    180
#       Min        0
#       Max      680
#       Fuzz       0
#       Flat       0
#       Resolution 12
#     Event code 47 (ABS_MT_SLOT)
#       Value      2
#       Min        0
#       Max        2
#       Fuzz       0
#       Flat       0
#       Resolution 0
#     Event code 53 (ABS_MT_POSITION_X)
#       Value      0
#       Min        0
#       Max     1216
#       Fuzz       0
#       Flat       0
#       Resolution 12
#     Event code 54 (ABS_MT_POSITION_Y)
#       Value      0
#       Min        0
#       Max      680
#       Fuzz       0
#       Flat       0
#       Resolution 12
#     Event code 57 (ABS_MT_TRACKING_ID)
#       Value      0
#       Min        0
#       Max    65535
#       Fuzz       0
#       Flat       0
#       Resolution 0
# Properties:
#   Property  type 0 (INPUT_PROP_POINTER)
#   Property  type 2 (INPUT_PROP_BUTTONPAD)
N: DLL0704:01 06CB:76AD Touchpad
I: 0018 06cb 76ad 0100
P: 05 00 00 00 00 00 00 00
B: 00 0b 00 00 00 00 00 00 00
B: 01 00 00 00 00 00 00 00 00
B: 01 00 00 00 00 00 00 00 00
B: 01 00 00 00 00 00 00 00 00
B: 01 00 00 00 00 00 00 00 00
B: 01 00 00 01 00 00 00 00 00
B: 01 20 64 00 00 00 00 00 00
B: 01 00 00 00 00 00 00 00 00
B: 01 00 00 00 00 00 00 00 00
B: 01 00 00 00 00 00 00 00 00
B: 01 00 00 00 00 00 00 00 00
B: 01 00 00 00 00 00 00 00 00
B: 01 00 00 00 00 00 00 00 00
B: 02 00 00 00 00 00 00 00 00
B: 03 03 00 00 00 00 80 60 02
B: 04 00 00 00 00 00 00 00 00
B: 05 00 00 00 00 00 00 00 00
B: 11 00 00 00 00 00 00 00 00
B: 12 00 00 00 00 00 00 00 00
B: 14 00 00 00 00 00 00 00 00
B: 15 00 00 00 00 00 00 00 00
B: 15 00 00 00 00 00 00 00 00
A: 00 0 1216 0 0 12
A: 01 0 680 0 0 12
A: 2f 0 2 0 0 0
A: 35 0 1216 0 0 12
A: 36 0 680 0 0 12
A: 39 0 65535 0 0 0
Comment 3 Peter Hutterer 2016-01-10 22:57:35 UTC
how big is your touchpad in mm? the kernel data says 102x57mm - is this correct?
Comment 4 Cyril B. 2016-01-11 21:04:20 UTC
According to my measurements, it's 105x60mm, so mostly correct.
Comment 5 Peter Hutterer 2016-01-27 06:00:08 UTC
can you judge how far you have to move the finger for scrolling to trigger? the threshold is now 1 mm, and it triggers based on time and partially on finger position too. if you have to move it more than 1mm, then that's a bug somewhere, if it's within 1mm then that's a drawback of the gesture detection code.
Comment 6 Cyril B. 2016-01-29 19:47:46 UTC
It's no more than 1mm, so I guess that's expected.
Comment 7 Peter Hutterer 2016-01-31 23:48:42 UTC
Have you re-run that with the no-hysteresis patch from bug 93503? Does that make it better?
Comment 8 Cyril B. 2016-02-06 17:27:58 UTC
Yes, and it didn't noticeably help.

I have patched libinput to set a move threshold to 0.2mm, and the scrolls are now basically instantaneous. The pinch gesture doesn't really work anymore (tested with libinput-debug-events), but since I never use it (and don't even know what applications do support it), I'm fine with that.
Comment 9 Peter Hutterer 2016-02-09 02:38:53 UTC
evemu-record yourself doing a couple of 'normal' scroll motions please. I wonder if there's some bias we can put into the system depending on the finger position. if not, there isn't much we can do about the threshold, unfortunately. 
We have the ability to cancel a gesture we cannot cancel a scroll motion. So we could start a pinch, cancel and switch to scroll but we can't go the other way round.
Comment 10 Cyril B. 2016-02-09 09:45:42 UTC
Created attachment 121614 [details]
3 normal scrolls

Here's a capture of 3 normal scrolls.
Comment 11 Peter Hutterer 2016-02-11 01:32:09 UTC
Data analysis of the initial finger data:

Touchpad dimensions: 101x56mm (1216x680 units)
New 2fg touch: distance 13mm (h 13mm v 2mm)
New 2fg touch: distance 13mm (h 13mm v 2mm)
New 2fg touch: distance 13mm (h 13mm v 2mm)
Max distance: 13mm, 166 units
Min distance 13mm, 162 units
Max distance: 13mm horiz 2mm vert
Min distance 13mm horiz, 2mm vert

the low vertical spread means we can add something to bias towards 2fg scrolling here. Let's see what I can come up with.
Comment 12 Peter Hutterer 2016-02-11 01:46:43 UTC
Created attachment 121661 [details] [review]
0001-touchpad-if-the-second-finger-is-within-20x5mm-bias-.patch
Comment 13 Cyril B. 2016-02-11 18:56:03 UTC
This is really perfect, the scrolls do start immediately. It feels even better than my ugly patch that set the threshold to 0.2mm. Thanks!
Comment 15 Peter Hutterer 2016-03-01 05:56:31 UTC
ok, this patch breaks (swipe) gestures pretty badly, I'll have to recall that. it's hard now to trigger a gesture without scroll events, something that will become a problem when gestures actually do something on the desktop. We'll need to find a different solution here.

The main problem is: for a swipe gesture, the fingers are effectively in the same position as for a two-finger scroll event. If the fingers are set down in separate event frames (likely) we transition from 1 to 2 to 3 fingers in the gesture state machine. When we hit two fingers we go to scrolling and send the current state before transitioning to 3 fingers and stopping the scrolling again.
Pinch gestures can be similarly affected if the two top fingers are set down before the thumb.

I think we'll need a scroll cancel event to work around this.
Comment 16 Peter Hutterer 2016-08-03 09:38:33 UTC
https://lists.freedesktop.org/archives/wayland-devel/2016-August/030325.html
not reducing the actual threshold, but still a step in the right direction I hope
Comment 17 Peter Hutterer 2016-08-05 04:38:30 UTC
commit a5450e99de680155b3ae9ebf84b8f196caa31c27
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date:   Wed Aug 3 18:30:05 2016 +1000

    gestures: reduce the 2fg scroll timeout to 150ms


Can you give libinput with this patch a try please and see if that improves things?
Comment 18 Peter Hutterer 2016-08-30 06:49:41 UTC
Calling it fixed based on a5450e99 and the silence thereafter, please reopen if it's still an issue


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.