diff options
author | Jason Gerecke <killertofu@gmail.com> | 2018-06-18 07:09:03 -0700 |
---|---|---|
committer | Jason Gerecke <killertofu@gmail.com> | 2019-09-04 09:42:49 -0700 |
commit | 65b7c37f0fac5cdd03ff7f977124148d0bdf4be8 (patch) | |
tree | a5c4562c021c409181313bc8acd3f7bc014a64c1 | |
parent | 8188891c120af14f3cea28ad72ed0cf61eaa2988 (diff) | |
download | xf86-input-wacom-65b7c37f0fac5cdd03ff7f977124148d0bdf4be8.tar.gz |
Prevent spurious right-clicks at the end of very short scroll and zoom gestures
If you perform a two-finger scroll/zoom gesture that takes less than
wcmTapTime milliseconds to complete and has the second touch going up
before the first, the wcmFingerTapToClick function may trigger a right-
click event as you complete the scroll/zoom. The reason for this is
that we call wcmFingerTapToClick for any non-scroll/zoom gesture state.
This isn't technically correct: we should really only be calling the
function when in the LAG state (i.e., while waiting for a two-finger
gesture to occur).
The logic which moves single-finger non-DRAG states into LAG or NONE
modes can conflict with simply checking for the LAG state before calling
wcmFingerTapToClick because very short drags can also be less than
WACOM_GESTURE_LAG_TIME, which will move the ZOOM and SCROLL states to
(single-finger) LAG mode and trigger the right-click gesture anyway.
To ensure this doesn't happen, we add a check for single-finger SCROLL
and ZOOM states just before this block and have it move the mode to
CANCEL which will only be reset once both fingers have gone up.
Fixes: 68daad26c11d ("improve initial 2 finger behavior")
Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
-rw-r--r-- | src/wcmTouchFilter.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/wcmTouchFilter.c b/src/wcmTouchFilter.c index 3846c88..e355544 100644 --- a/src/wcmTouchFilter.c +++ b/src/wcmTouchFilter.c @@ -435,6 +435,14 @@ void wcmGestureFilter(WacomDevicePtr priv, int touch_id) if (common->wcmGestureMode == GESTURE_NONE_MODE) common->wcmGestureMode = GESTURE_LAG_MODE; } + /* If we're in a multitouch mode but two fingers aren't in proximity + * we should directly head to CANCEL mode and wait for both fingers + * to leave the screen. + */ + else if (common->wcmGestureMode & (GESTURE_SCROLL_MODE | GESTURE_ZOOM_MODE)) + { + common->wcmGestureMode = GESTURE_CANCEL_MODE; + } /* When only 1 finger is in proximity, it can be in either LAG mode, * NONE mode or DRAG mode. * 1 finger LAG mode is a very short time period mainly to debounce @@ -517,7 +525,7 @@ void wcmGestureFilter(WacomDevicePtr priv, int touch_id) goto ret; } - if (!(common->wcmGestureMode & (GESTURE_SCROLL_MODE | GESTURE_ZOOM_MODE)) && touch_id == 1) + if ((common->wcmGestureMode & GESTURE_LAG_MODE) && touch_id == 1) wcmFingerTapToClick(priv); /* Change mode happens only when both fingers are out */ |