diff --git a/0001-touchpad-end-tap-and-drag-with-an-extra-tap.patch b/0001-touchpad-end-tap-and-drag-with-an-extra-tap.patch new file mode 100644 index 0000000..a473cdd --- /dev/null +++ b/0001-touchpad-end-tap-and-drag-with-an-extra-tap.patch @@ -0,0 +1,1405 @@ +From 1ab385bc83504272cf4507d72ac0d6ab448aac9c Mon Sep 17 00:00:00 2001 +From: Velimir Lisec +Date: Thu, 30 Apr 2015 00:13:51 +0200 +Subject: [PATCH libinput] touchpad: end tap-and-drag with an extra tap + +Currently for the tap-and-drag gesture to end user has to wait for a +timeout to expire. Make it possible to end the drag gesture by just tapping. + +The allowed finger sequences to start and end a drag are thus: +tap, down, .... move ...., up +tap, down, .... move ...., up, tap + +https://bugs.freedesktop.org/show_bug.cgi?id=90255 + +Signed-off-by: Velimir Lisec +Reviewed-by: Peter Hutterer + +State diagram changes and a doc change squashed in. + +Signed-off-by: Peter Hutterer +--- + doc/tapping.dox | 4 + + doc/touchpad-tap-state-machine.svg | 479 ++++++++++++++++++++----------------- + src/evdev-mt-touchpad-tap.c | 40 +++- + src/evdev-mt-touchpad.h | 1 + + 4 files changed, 304 insertions(+), 220 deletions(-) + +diff --git a/doc/tapping.dox b/doc/tapping.dox +index f603b7d..7eb81e6 100644 +--- a/doc/tapping.dox ++++ b/doc/tapping.dox +@@ -33,6 +33,10 @@ continue the dragging process, so that multiple touchpad-widths of distance + can be covered easily. If two-fingers are supported by the hardware, a + second finger can be used to drag while the first is held in-place. + ++An alternative method to end a drag process is to tap immediately after ++lifting the finger. The full sequence is thus: tap, finger down, drag, ++finger up, tap. ++ + @section tap_constraints Constraints while tapping + + A couple of constraints apply to the contact to be converted into a press, the most common ones are: +diff --git a/doc/touchpad-tap-state-machine.svg b/doc/touchpad-tap-state-machine.svg +index b168b4f..39b0b86 100644 +--- a/doc/touchpad-tap-state-machine.svg ++++ b/doc/touchpad-tap-state-machine.svg +@@ -14,93 +14,93 @@ + + + +- IDLE ++ IDLE + + + + +- TOUCH ++ TOUCH + + + + +- first ++ first + +- finger down ++ finger down + + + + + + +- finger up ++ finger up + + + + + + +- button 1 ++ button 1 + +- press ++ press + + + + +- timeout ++ timeout + + + + + + +- move > ++ move > + +- threshold ++ threshold + + + + + + +- second ++ second + +- finger down ++ finger down + + + + + + +- TOUCH_2 ++ TOUCH_2 + + + + +- second ++ second + +- finger up ++ finger up + + + + + + +- button 2 ++ button 2 + +- press ++ press + + + + +- move > ++ move > + +- threshold ++ threshold + + + + +- timeout ++ timeout + + + +@@ -109,16 +109,16 @@ + + + +- button 1 ++ button 1 + +- release ++ release + + + + +- button 2 ++ button 2 + +- release ++ release + + + +@@ -127,42 +127,42 @@ + + + +- TAPPED ++ TAPPED + + + + +- timeout ++ timeout + + + + + + +- first ++ first + +- finger down ++ finger down + + + + + + +- DRAGGING ++ DRAGGING + + + + +- first ++ first + +- finger up ++ finger up + + + + +- btn1 ++ btn1 + +- release ++ release + + + +@@ -173,81 +173,81 @@ + + + +- IDLE ++ IDLE + + + + +- third ++ third + +- finger down ++ finger down + + + + + + +- TOUCH_3 ++ TOUCH_3 + + + + + + +- button 3 ++ button 3 + +- press ++ press + + + + +- button 3 ++ button 3 + +- release ++ release + + + + + + +- move > ++ move > + +- threshold ++ threshold + + + + + + +- IDLE ++ IDLE + + + + +- timeout ++ timeout + + + + + + +- first ++ first + +- finger up ++ finger up + + + + + + +- IDLE ++ IDLE + + + + +- fourth ++ fourth + +- finger down ++ finger down + + + +@@ -256,64 +256,64 @@ + + + +- DRAGGING_OR_DOUBLETAP ++ DRAGGING_OR_DOUBLETAP + + + + + + +- timeout ++ timeout + + + + + + +- first ++ first + +- finger up ++ finger up + + + + + + +- button 1 ++ button 1 + +- release ++ release + + + + +- button 1 ++ button 1 + +- press ++ press + + + + +- btn1 ++ btn1 + +- release ++ release + + + + + + +- second ++ second + +- finger down ++ finger down + + + + + + +- move > ++ move > + +- threshold ++ threshold + + + +@@ -322,14 +322,14 @@ + + + +- HOLD ++ HOLD + + + + +- first ++ first + +- finger up ++ finger up + + + +@@ -338,9 +338,9 @@ + + + +- second ++ second + +- finger down ++ finger down + + + +@@ -351,23 +351,23 @@ + + + +- TOUCH_2_HOLD ++ TOUCH_2_HOLD + + + + +- second ++ second + +- finger up ++ finger up + + + + + + +- first ++ first + +- finger up ++ finger up + + + +@@ -378,9 +378,9 @@ + + + +- third ++ third + +- finger down ++ finger down + + + +@@ -391,21 +391,21 @@ + + + +- TOUCH_3_HOLD ++ TOUCH_3_HOLD + + + + + + +- fourth ++ fourth + +- finger down ++ finger down + + + + +- DEAD ++ DEAD + + + +@@ -416,19 +416,19 @@ + + + +- any finger up ++ any finger up + + + + +- fourth ++ fourth + +- finger up ++ finger up + + + + +- any finger up ++ any finger up + + + +@@ -437,12 +437,12 @@ + + + +- yes ++ yes + + + + +- any finger up ++ any finger up + + + +@@ -455,14 +455,14 @@ + + + +- IDLE ++ IDLE + + + + +- if finger ++ if finger + +- count == 0 ++ count == 0 + + + +@@ -473,14 +473,14 @@ + + + +- second ++ second + +- finger up ++ finger up + + + + +- DRAGGING_2 ++ DRAGGING_2 + + + +@@ -489,9 +489,9 @@ + + + +- first ++ first + +- finger up ++ finger up + + + +@@ -502,9 +502,9 @@ + + + +- second ++ second + +- finger down ++ finger down + + + +@@ -515,29 +515,29 @@ + + + +- third ++ third + +- finger down ++ finger down + + + + + + +- btn1 ++ btn1 + +- release ++ release + + + + + + +- phys ++ phys + +- button ++ button + +- press ++ press + + + +@@ -554,23 +554,23 @@ + + + +- phys ++ phys + +- button ++ button + +- press ++ press + + + +- ++ + +- +- button 1 +- +- release ++ ++ button 1 ++ ++ release + +- +- ++ ++ + + + +@@ -582,12 +582,12 @@ + + + +- DRAGGING_WAIT ++ DRAGGING_WAIT + + + + +- timeout ++ timeout + + + +@@ -598,21 +598,21 @@ + + + +- first ++ first + +- finger down ++ finger down + + + + + + +- TOUCH_TOUCH ++ TOUCH_TOUCH + + + + +- TOUCH_IDLE ++ TOUCH_IDLE + + + +@@ -625,7 +625,7 @@ + + + +- TOUCH_DEAD ++ TOUCH_DEAD + + + +@@ -640,12 +640,12 @@ + + + +- yes ++ yes + + + + +- TOUCH_DEAD ++ TOUCH_DEAD + + + +@@ -656,14 +656,14 @@ + + + +- TOUCH_IDLE ++ TOUCH_IDLE + + + + + + +- TOUCH_TOUCH ++ TOUCH_TOUCH + + + +@@ -672,44 +672,44 @@ + + + +- TOUCH_IDLE ++ TOUCH_IDLE + + + + + + +- TOUCH_IDLE ++ TOUCH_IDLE + + + + + + +- TOUCH_IDLE ++ TOUCH_IDLE + + + + + + +- TOUCH_TOUCH ++ TOUCH_TOUCH + + + + + + +- that finger ++ that finger + +- TOUCH_IDLE ++ TOUCH_IDLE + + + + + + +- TOUCH_DEAD ++ TOUCH_DEAD + + + +@@ -720,9 +720,9 @@ + + + +- that finger ++ that finger + +- TOUCH_IDLE ++ TOUCH_IDLE + + + +@@ -731,31 +731,31 @@ + + + +- no ++ no + + + + +- TOUCH_TOUCH ++ TOUCH_TOUCH + + + + + + +- TOUCH_IDLE ++ TOUCH_IDLE + + + + +- TOUCH_TOUCH ++ TOUCH_TOUCH + + + + + + +- TOUCH_DEAD ++ TOUCH_DEAD + + + +@@ -764,175 +764,171 @@ + + + +- TOUCH_IDLE ++ TOUCH_IDLE + + + +- ++ + +- +- TOUCH_TOUCH ++ ++ TOUCH_TOUCH + +- +- +- +- + + + +- TOUCH_TOUCH ++ TOUCH_TOUCH + + + + + + +- TOUCH_IDLE ++ TOUCH_IDLE + + + + + + +- TOUCH_IDLE ++ TOUCH_IDLE + + + + + + +- TOUCH_TOUCH ++ TOUCH_TOUCH + + + + + + +- TOUCH_IDLE ++ TOUCH_IDLE + + + + + + +- TOUCH_TOUCH ++ TOUCH_TOUCH + + + + + + +- that finger ++ that finger + +- TOUCH_IDLE ++ TOUCH_IDLE + + + + + + +- TOUCH_DEAD ++ TOUCH_DEAD + + + + + + +- TOUCH_DEAD ++ TOUCH_DEAD + + + + +- TOUCH_DEAD ++ TOUCH_DEAD + + + + +- TOUCH_DEAD ++ TOUCH_DEAD + +- +- ++ ++ + + + +- TOUCH_DEAD ++ TOUCH_DEAD + + + + + + +- TOUCH_DEAD ++ TOUCH_DEAD + + + + + + +- state == ++ state == + +- TOUCH_TOUCH ++ TOUCH_TOUCH + + + + +- that finger state == ++ that finger state == + +- TOUCH_TOUCH ++ TOUCH_TOUCH + + + + + + +- no ++ no + + + + +- TOUCH_DEAD ++ TOUCH_DEAD + + + + + + +- TOUCH_DEAD ++ TOUCH_DEAD + + + + +- TOUCH_DEAD ++ TOUCH_DEAD + + + + +- first ++ first + +- finger down ++ finger down + +- ++ + +- +- MULTITAP ++ ++ MULTITAP + +- +- +- +- ++ ++ ++ ++ + + + +- timeout ++ timeout + + + +- +- ++ ++ + + + +- IDLE ++ IDLE + + + +@@ -943,14 +939,14 @@ + + + +- MULTITAP_DOWN ++ MULTITAP_DOWN + + + + +- button 1 ++ button 1 + +- press ++ press + + + +@@ -959,39 +955,39 @@ + + + +- first ++ first + +- finger up ++ finger up + + + + + + +- button 1 ++ button 1 + +- release ++ release + + + + + + +- timeout ++ timeout + + + + +- second ++ second + +- finger down ++ finger down + + + + +- move > ++ move > + +- threshold ++ threshold + + + +@@ -1002,16 +998,16 @@ + + + +- button 1 ++ button 1 + +- release ++ release + + + + +- button 1 ++ button 1 + +- press ++ press + + + +@@ -1022,16 +1018,16 @@ + + + +- button 1 ++ button 1 + +- release ++ release + + + + +- button 1 ++ button 1 + +- press ++ press + + + +@@ -1042,16 +1038,16 @@ + + + +- button 1 ++ button 1 + +- release ++ release + + + + +- button 1 ++ button 1 + +- press ++ press + + + +@@ -1059,36 +1055,87 @@ + + + +- +- ++ ++ + + + +- TOUCH_TOUCH ++ TOUCH_TOUCH + + + + + + +- TOUCH_IDLE ++ TOUCH_IDLE + + + + + + +- phys ++ phys + +- button ++ button + +- press ++ press + +- +- ++ ++ + + + + ++ ++ ++ ++ DRAGGING_OR_TAP ++ ++ ++ ++ ++ first ++ ++ finger up ++ ++ ++ ++ ++ ++ ++ timeout ++ ++ ++ ++ ++ ++ ++ ++ ++ move > ++ ++ threshold ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ TOUCH_IDLE ++ ++ ++ ++ ++ ++ ++ + + +diff --git a/src/evdev-mt-touchpad-tap.c b/src/evdev-mt-touchpad-tap.c +index 61f94e5..fb8c9e4 100644 +--- a/src/evdev-mt-touchpad-tap.c ++++ b/src/evdev-mt-touchpad-tap.c +@@ -74,6 +74,7 @@ tap_state_to_str(enum tp_tap_state state) + CASE_RETURN_STRING(TAP_STATE_DRAGGING); + CASE_RETURN_STRING(TAP_STATE_DRAGGING_WAIT); + CASE_RETURN_STRING(TAP_STATE_DRAGGING_OR_DOUBLETAP); ++ CASE_RETURN_STRING(TAP_STATE_DRAGGING_OR_TAP); + CASE_RETURN_STRING(TAP_STATE_DRAGGING_2); + CASE_RETURN_STRING(TAP_STATE_MULTITAP); + CASE_RETURN_STRING(TAP_STATE_MULTITAP_DOWN); +@@ -409,16 +410,42 @@ tp_tap_dragging_wait_handle_event(struct tp_dispatch *tp, + + switch (event) { + case TAP_EVENT_TOUCH: +- tp->tap.state = TAP_STATE_DRAGGING; ++ tp->tap.state = TAP_STATE_DRAGGING_OR_TAP; ++ tp_tap_set_timer(tp, time); ++ break; ++ case TAP_EVENT_RELEASE: ++ case TAP_EVENT_MOTION: ++ break; ++ case TAP_EVENT_TIMEOUT: ++ tp->tap.state = TAP_STATE_IDLE; ++ tp_tap_notify(tp, time, 1, LIBINPUT_BUTTON_STATE_RELEASED); ++ break; ++ case TAP_EVENT_BUTTON: ++ tp->tap.state = TAP_STATE_DEAD; ++ tp_tap_notify(tp, time, 1, LIBINPUT_BUTTON_STATE_RELEASED); ++ break; ++ } ++} ++ ++static void ++tp_tap_dragging_tap_handle_event(struct tp_dispatch *tp, ++ struct tp_touch *t, ++ enum tap_event event, uint64_t time) ++{ ++ ++ switch (event) { ++ case TAP_EVENT_TOUCH: ++ tp->tap.state = TAP_STATE_DRAGGING_2; + tp_tap_clear_timer(tp); + break; + case TAP_EVENT_RELEASE: +- case TAP_EVENT_MOTION: +- break; +- case TAP_EVENT_TIMEOUT: + tp->tap.state = TAP_STATE_IDLE; + tp_tap_notify(tp, time, 1, LIBINPUT_BUTTON_STATE_RELEASED); + break; ++ case TAP_EVENT_MOTION: ++ case TAP_EVENT_TIMEOUT: ++ tp->tap.state = TAP_STATE_DRAGGING; ++ break; + case TAP_EVENT_BUTTON: + tp->tap.state = TAP_STATE_DEAD; + tp_tap_notify(tp, time, 1, LIBINPUT_BUTTON_STATE_RELEASED); +@@ -588,6 +615,9 @@ tp_tap_handle_event(struct tp_dispatch *tp, + case TAP_STATE_DRAGGING_WAIT: + tp_tap_dragging_wait_handle_event(tp, t, event, time); + break; ++ case TAP_STATE_DRAGGING_OR_TAP: ++ tp_tap_dragging_tap_handle_event(tp, t, event, time); ++ break; + case TAP_STATE_DRAGGING_2: + tp_tap_dragging2_handle_event(tp, t, event, time); + break; +@@ -692,6 +722,7 @@ tp_tap_handle_state(struct tp_dispatch *tp, uint64_t time) + case TAP_STATE_TOUCH: + case TAP_STATE_TAPPED: + case TAP_STATE_DRAGGING_OR_DOUBLETAP: ++ case TAP_STATE_DRAGGING_OR_TAP: + case TAP_STATE_TOUCH_2: + case TAP_STATE_TOUCH_3: + case TAP_STATE_MULTITAP_DOWN: +@@ -870,6 +901,7 @@ tp_tap_dragging(struct tp_dispatch *tp) + case TAP_STATE_DRAGGING: + case TAP_STATE_DRAGGING_2: + case TAP_STATE_DRAGGING_WAIT: ++ case TAP_STATE_DRAGGING_OR_TAP: + return true; + default: + return false; +diff --git a/src/evdev-mt-touchpad.h b/src/evdev-mt-touchpad.h +index 3711375..f602359 100644 +--- a/src/evdev-mt-touchpad.h ++++ b/src/evdev-mt-touchpad.h +@@ -94,6 +94,7 @@ enum tp_tap_state { + TAP_STATE_TOUCH_3, + TAP_STATE_TOUCH_3_HOLD, + TAP_STATE_DRAGGING_OR_DOUBLETAP, ++ TAP_STATE_DRAGGING_OR_TAP, + TAP_STATE_DRAGGING, + TAP_STATE_DRAGGING_WAIT, + TAP_STATE_DRAGGING_2, +-- +2.4.1 + diff --git a/libinput.spec b/libinput.spec index 9fb5efc..5651e2a 100644 --- a/libinput.spec +++ b/libinput.spec @@ -5,7 +5,7 @@ Name: libinput Version: 0.15.0 -Release: 3%{?gitdate:.%{gitdate}git%{gitversion}}%{?dist} +Release: 4%{?gitdate:.%{gitdate}git%{gitversion}}%{?dist} Summary: Input device library License: MIT @@ -33,6 +33,9 @@ Patch11: 0008-touchpad-reset-the-touch-state-when-edge-scrolling-i.patch Patch12: 0009-touchpad-don-t-enable-edge-palm-detection-on-Wacom-t.patch Patch13: 0010-touchpad-touches-after-the-last-key-press-can-be-rel.patch +# Bug 1225998 - Tap-and-drag touchpad behavior not configurable +Patch14: 0001-touchpad-end-tap-and-drag-with-an-extra-tap.patch + BuildRequires: git BuildRequires: autoconf automake libtool pkgconfig BuildRequires: libevdev-devel @@ -108,6 +111,9 @@ find $RPM_BUILD_ROOT -name '*.la' -delete %changelog +* Fri May 29 2015 Peter Hutterer 0.15.0-4 +- Add tap-to-end-drag patch (#1225998) + * Wed May 27 2015 Peter Hutterer 0.15.0-3 - Refine disable-while-typing (#1209753)