From b73b0969101f2c159c31cee696a6057833e666fe Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Sat, 19 Sep 2015 05:00:20 +1000 Subject: [PATCH] Fix the number of clicks sent in multitap (fdo #92016) --- ...-number-of-button-clicks-in-multitap.patch | 2047 +++++++++++++++++ libinput.spec | 8 +- 2 files changed, 2054 insertions(+), 1 deletion(-) create mode 100644 0001-touchpad-fix-the-number-of-button-clicks-in-multitap.patch diff --git a/0001-touchpad-fix-the-number-of-button-clicks-in-multitap.patch b/0001-touchpad-fix-the-number-of-button-clicks-in-multitap.patch new file mode 100644 index 0000000..f6bc209 --- /dev/null +++ b/0001-touchpad-fix-the-number-of-button-clicks-in-multitap.patch @@ -0,0 +1,2047 @@ +From d92ae62dad53afd894aec3c47081780ef3d9b4d2 Mon Sep 17 00:00:00 2001 +From: Peter Hutterer +Date: Fri, 18 Sep 2015 09:14:43 +1000 +Subject: [PATCH libinput] touchpad: fix the number of button clicks in + multitap + +tap-tap-down-move should emit 1 click + press, not 2 clicks + press + +https://bugs.freedesktop.org/show_bug.cgi?id=92016 + +Signed-off-by: Peter Hutterer +Reviewed-by: Hans de Goede +--- + doc/touchpad-tap-state-machine.svg | 1449 +++++++++++++++++------------------- + src/evdev-mt-touchpad-tap.c | 10 - + test/touchpad-tap.c | 10 +- + 3 files changed, 703 insertions(+), 766 deletions(-) + +diff --git a/doc/touchpad-tap-state-machine.svg b/doc/touchpad-tap-state-machine.svg +index 9fee48a..92fdb2b 100644 +--- a/doc/touchpad-tap-state-machine.svg ++++ b/doc/touchpad-tap-state-machine.svg +@@ -1,1112 +1,1058 @@ + + +- ++ + + +- +- +- +- +- +- +- ++ ++ ++ ++ ++ ++ ++ + +- ++ + IDLE + +- ++ + +- ++ + TOUCH + +- ++ + +- ++ + first +- ++ + finger down + +- +- +- ++ ++ ++ + +- ++ + finger up + +- +- +- ++ ++ ++ + +- ++ + button 1 +- ++ + press + +- ++ + +- ++ + timeout + +- +- +- ++ ++ ++ + +- ++ + move > +- ++ + threshold + +- +- +- ++ ++ ++ + +- ++ + second +- ++ + finger down + +- +- +- ++ ++ ++ + +- ++ + TOUCH_2 + +- ++ + +- ++ + second +- ++ + finger up + +- +- +- ++ ++ ++ + +- ++ + button 2 +- ++ + press + +- ++ + +- ++ + move > +- ++ + threshold + +- ++ + +- ++ + timeout + +- +- +- +- +- ++ ++ ++ ++ ++ + +- ++ + button 1 +- ++ + release + +- ++ + +- ++ + button 2 +- ++ + release + +- +- +- +- +- ++ ++ ++ ++ ++ + +- ++ + TAPPED + +- ++ + +- ++ + timeout + +- +- +- ++ ++ ++ + +- ++ + first +- ++ + finger down + +- +- +- ++ ++ ++ + +- ++ + DRAGGING + +- ++ + +- ++ + first +- ++ + finger up + +- ++ + +- ++ + btn1 +- ++ + release + +- +- +- +- +- +- +- ++ ++ ++ ++ ++ ++ ++ + +- ++ + IDLE + +- ++ + +- ++ + third +- ++ + finger down + +- +- +- ++ ++ ++ + +- ++ + TOUCH_3 + +- +- +- ++ ++ ++ + +- ++ + button 3 +- ++ + press + +- ++ + +- ++ + button 3 +- ++ + release + +- +- +- ++ ++ ++ + +- ++ + move > +- ++ + threshold + +- +- +- ++ ++ ++ + +- ++ + IDLE + +- ++ + +- ++ + timeout + +- +- +- ++ ++ ++ + +- ++ + first +- ++ + finger up + +- +- +- ++ ++ ++ + +- ++ + IDLE + +- ++ + +- ++ + fourth +- ++ + finger down + +- +- +- +- +- ++ ++ ++ ++ ++ + +- ++ + DRAGGING_OR_DOUBLETAP + +- +- +- ++ ++ ++ + +- ++ + timeout + +- +- +- ++ ++ ++ + +- ++ + first +- ++ + finger up + +- +- +- ++ ++ ++ + +- ++ + button 1 +- ++ + release + +- ++ + +- ++ + button 1 +- ++ + press + +- ++ + +- ++ + btn1 +- ++ + release + +- +- +- ++ ++ ++ + +- ++ + second +- ++ + finger down + +- +- +- ++ ++ ++ + +- ++ + move > +- ++ + threshold + +- +- +- +- +- ++ ++ ++ ++ ++ + +- ++ + HOLD + +- ++ + +- ++ + first +- ++ + finger up + +- +- +- +- +- ++ ++ ++ ++ ++ + +- ++ + second +- ++ + finger down + +- +- +- +- +- ++ ++ ++ ++ ++ + +- ++ + TOUCH_2_HOLD + +- ++ + +- ++ + second +- ++ + finger up + +- +- +- ++ ++ ++ + +- ++ + first +- ++ + finger up + +- +- +- +- +- +- +- ++ ++ ++ ++ ++ ++ ++ + +- ++ + third +- ++ + finger down + +- +- +- +- +- +- +- ++ ++ ++ ++ ++ ++ ++ + +- ++ + TOUCH_3_HOLD + +- +- +- ++ ++ ++ + +- ++ + fourth +- ++ + finger down + +- ++ + +- ++ + DEAD + +- +- +- +- +- +- +- ++ ++ ++ ++ ++ ++ ++ + +- ++ + any finger up + +- ++ + +- ++ + fourth +- ++ + finger up + +- ++ + +- ++ + any finger up + +- +- +- +- ++ ++ ++ ++ + +- +- ++ ++ + yes + +- ++ + +- ++ + any finger up + +- +- +- +- +- +- +- +- +- ++ ++ ++ ++ ++ ++ ++ ++ ++ + +- ++ + IDLE + +- ++ + +- ++ + if finger +- ++ + count == 0 + +- +- +- +- +- +- +- ++ ++ ++ ++ ++ ++ ++ + +- ++ + second +- ++ + finger up + +- ++ + +- ++ + DRAGGING_2 + +- +- +- +- +- ++ ++ ++ ++ ++ + +- ++ + first +- ++ + finger up + +- +- +- +- +- +- +- ++ ++ ++ ++ ++ ++ ++ + +- ++ + second +- ++ + finger down + +- +- +- +- +- +- +- ++ ++ ++ ++ ++ ++ ++ + +- ++ + third +- ++ + finger down + +- +- +- ++ ++ ++ + +- ++ + btn1 +- ++ + release + +- +- +- ++ ++ ++ + +- ++ + phys +- ++ + button +- ++ + press + +- +- +- +- +- +- +- +- +- +- +- +- +- ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ + +- ++ + phys +- ++ + button +- ++ + press + +- +- +- ++ ++ ++ + +- ++ + button 1 +- ++ + release + +- +- +- +- +- +- +- +- +- +- +- ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ + +- ++ + DRAGGING_WAIT + +- ++ + +- ++ + timeout + +- +- +- +- +- +- +- ++ ++ ++ ++ ++ ++ ++ + +- ++ + first +- ++ + finger down + +- +- +- ++ ++ ++ + +- ++ + TOUCH_TOUCH + +- ++ + +- ++ + TOUCH_IDLE + +- +- +- +- +- +- +- +- +- ++ ++ ++ ++ ++ ++ ++ ++ ++ + +- ++ + TOUCH_DEAD + +- +- +- +- +- +- +- +- +- ++ ++ ++ ++ ++ ++ ++ ++ ++ + +- ++ + TOUCH_DEAD + +- +- +- +- +- +- +- ++ ++ ++ ++ ++ ++ ++ + +- ++ + TOUCH_IDLE + +- +- +- ++ ++ ++ + +- ++ + TOUCH_TOUCH + +- +- +- +- +- ++ ++ ++ ++ ++ + +- ++ + TOUCH_IDLE + +- +- +- ++ ++ ++ + +- ++ + TOUCH_IDLE + +- +- +- ++ ++ ++ + +- ++ + TOUCH_TOUCH + +- +- +- ++ ++ ++ + +- ++ + that finger +- ++ + TOUCH_IDLE + +- +- +- ++ ++ ++ + +- ++ + TOUCH_DEAD + +- +- +- +- +- +- +- ++ ++ ++ ++ ++ ++ ++ + +- ++ + that finger +- ++ + TOUCH_IDLE + +- +- +- +- ++ ++ ++ ++ + +- +- ++ ++ + no + +- ++ + +- ++ + TOUCH_TOUCH + +- +- +- ++ ++ ++ + +- ++ + TOUCH_IDLE + +- ++ + +- ++ + TOUCH_TOUCH + +- +- +- ++ ++ ++ + +- ++ + TOUCH_DEAD + +- +- +- +- +- ++ ++ ++ ++ ++ + +- ++ + TOUCH_IDLE + +- +- +- ++ ++ ++ + +- ++ + TOUCH_TOUCH + +- ++ + +- ++ + TOUCH_TOUCH + +- +- +- ++ ++ ++ + +- ++ + TOUCH_IDLE + +- +- +- ++ ++ ++ + +- ++ + TOUCH_IDLE + +- +- +- ++ ++ ++ + +- ++ + TOUCH_TOUCH + +- +- +- ++ ++ ++ + +- ++ + TOUCH_IDLE + +- +- +- ++ ++ ++ + +- ++ + TOUCH_TOUCH + +- +- +- ++ ++ ++ + +- ++ + that finger +- ++ + TOUCH_IDLE + +- +- +- ++ ++ ++ + +- ++ + TOUCH_DEAD + +- +- +- ++ ++ ++ + +- ++ + TOUCH_DEAD + +- ++ + +- ++ + TOUCH_DEAD + +- ++ + +- ++ + TOUCH_DEAD + +- +- +- ++ ++ ++ + +- ++ + TOUCH_DEAD + +- +- +- ++ ++ ++ + +- ++ + TOUCH_DEAD + +- +- +- ++ ++ ++ + +- ++ + that finger state == +- ++ + TOUCH_TOUCH + +- ++ + +- ++ + TOUCH_DEAD + +- +- +- ++ ++ ++ + +- ++ + TOUCH_DEAD + +- ++ + +- ++ + TOUCH_DEAD + +- ++ + +- ++ + first +- ++ + finger down + +- ++ + +- ++ + MULTITAP + +- +- +- +- +- ++ ++ ++ ++ ++ + +- ++ + timeout + +- +- +- +- +- ++ ++ ++ ++ ++ + +- ++ + IDLE + +- +- +- +- +- +- +- ++ ++ ++ ++ ++ ++ ++ + +- ++ + MULTITAP_DOWN + +- ++ + +- ++ + button 1 +- ++ + press + +- +- +- +- +- ++ ++ ++ ++ ++ + +- ++ + first +- ++ + finger up + +- +- +- ++ ++ ++ + +- ++ + button 1 +- ++ + release + +- +- +- ++ ++ ++ + +- ++ + timeout + +- ++ + +- ++ + second +- ++ + finger down + +- ++ + +- ++ + move > +- ++ + threshold + +- +- +- +- +- +- +- ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ + +- +- button 1 +- +- release +- +- +- +- +- button 1 +- +- press +- +- +- +- +- +- +- +- +- +- +- button 1 +- +- release +- +- +- +- +- button 1 +- +- press +- +- +- +- +- +- +- +- +- +- +- button 1 +- +- release +- +- +- +- +- button 1 +- +- press +- +- +- +- +- +- +- +- +- +- +- +- ++ + TOUCH_TOUCH + +- +- +- ++ ++ ++ + +- ++ + TOUCH_IDLE + +- +- +- ++ ++ ++ + +- ++ + phys +- ++ + button +- ++ + press + +- +- +- +- +- +- +- ++ ++ ++ ++ ++ ++ ++ + +- ++ + DRAGGING_OR_TAP + +- ++ + +- ++ + first +- ++ + finger up + +- +- +- ++ ++ ++ + +- ++ + timeout + +- +- +- +- +- ++ ++ ++ ++ ++ + +- ++ + move > +- ++ + threshold + +- +- +- +- +- +- +- +- +- +- +- ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ + +- ++ + TOUCH_IDLE + +- +- +- +- +- +- +- +- ++ ++ ++ ++ ++ ++ ++ ++ + + +
+@@ -1120,9 +1066,9 @@ + [Not supported by viewer] + + +- +- +- ++ ++ ++ + + +
+@@ -1134,9 +1080,9 @@ + [Not supported by viewer] + + +- +- +- ++ ++ ++ + + +
+@@ -1149,115 +1095,116 @@ + [Not supported by viewer] + + +- ++ + +- ++ + thumb + +- +- +- ++ ++ ++ + +- ++ + TOUCH_DEAD + +- +- +- +- +- +- +- ++ ++ ++ ++ ++ ++ ++ + +- ++ + TOUCH_2_RELEASE + +- ++ + +- ++ + second +- ++ + finger up + +- +- +- ++ ++ ++ + +- ++ + timeout + +- +- +- ++ ++ ++ + +- ++ + move > +- ++ + threshold + +- +- +- +- +- +- +- +- +- ++ ++ ++ ++ ++ ++ ++ ++ ++ + +- ++ + first +- ++ + finger down + +- +- +- +- +- ++ ++ ++ ++ ++ + +- ++ + TOUCH_IDLE + +- +- +- ++ ++ ++ + +- ++ + first +- ++ + finger up + +- +- +- +- +- ++ ++ ++ ++ ++ + +- ++ + second +- ++ + finger down + +- +- +- ++ ++ ++ + +- ++ + TOUCH_DEAD + +- ++ + +- ++ + TOUCH_DEAD + +- +- +- +- +- +- +- +- ++ ++ ++ ++ ++ ++ ++ ++ + + ++ +diff --git a/src/evdev-mt-touchpad-tap.c b/src/evdev-mt-touchpad-tap.c +index 753fc6b..dda528a 100644 +--- a/src/evdev-mt-touchpad-tap.c ++++ b/src/evdev-mt-touchpad-tap.c +@@ -596,21 +596,11 @@ tp_tap_multitap_down_handle_event(struct tp_dispatch *tp, + break; + case TAP_EVENT_TOUCH: + tp->tap.state = TAP_STATE_DRAGGING_2; +- tp_tap_notify(tp, +- tp->tap.multitap_last_time, +- 1, +- LIBINPUT_BUTTON_STATE_RELEASED); +- tp_tap_notify(tp, time, 1, LIBINPUT_BUTTON_STATE_PRESSED); + tp_tap_clear_timer(tp); + break; + case TAP_EVENT_MOTION: + case TAP_EVENT_TIMEOUT: + tp->tap.state = TAP_STATE_DRAGGING; +- tp_tap_notify(tp, +- tp->tap.multitap_last_time, +- 1, +- LIBINPUT_BUTTON_STATE_RELEASED); +- tp_tap_notify(tp, time, 1, LIBINPUT_BUTTON_STATE_PRESSED); + tp_tap_clear_timer(tp); + break; + case TAP_EVENT_BUTTON: +diff --git a/test/touchpad-tap.c b/test/touchpad-tap.c +index 334d797..4450ec3 100644 +--- a/test/touchpad-tap.c ++++ b/test/touchpad-tap.c +@@ -191,7 +191,7 @@ START_TEST(touchpad_1fg_multitap_n_drag_move) + litest_touch_move_to(dev, 0, 50, 50, 70, 50, 10, 4); + libinput_dispatch(li); + +- for (ntaps = 0; ntaps <= range; ntaps++) { ++ for (ntaps = 0; ntaps < range; ntaps++) { + event = libinput_get_event(li); + ptrev = litest_is_button_event(event, + BTN_LEFT, +@@ -261,7 +261,7 @@ START_TEST(touchpad_1fg_multitap_n_drag_2fg) + litest_touch_down(dev, 1, 70, 50); + libinput_dispatch(li); + +- for (ntaps = 0; ntaps <= range; ntaps++) { ++ for (ntaps = 0; ntaps < range; ntaps++) { + event = libinput_get_event(li); + ptrev = litest_is_button_event(event, + BTN_LEFT, +@@ -393,7 +393,7 @@ START_TEST(touchpad_1fg_multitap_n_drag_timeout) + litest_timeout_tap(); + libinput_dispatch(li); + +- for (ntaps = 0; ntaps <= range; ntaps++) { ++ for (ntaps = 0; ntaps < range; ntaps++) { + event = libinput_get_event(li); + ptrev = litest_is_button_event(event, + BTN_LEFT, +@@ -464,7 +464,7 @@ START_TEST(touchpad_1fg_multitap_n_drag_tap) + litest_timeout_tap(); + libinput_dispatch(li); + +- for (ntaps = 0; ntaps <= range; ntaps++) { ++ for (ntaps = 0; ntaps < range; ntaps++) { + event = libinput_get_event(li); + ptrev = litest_is_button_event(event, + BTN_LEFT, +@@ -537,7 +537,7 @@ START_TEST(touchpad_1fg_multitap_n_drag_tap_click) + litest_timeout_tap(); + libinput_dispatch(li); + +- for (ntaps = 0; ntaps <= range; ntaps++) { ++ for (ntaps = 0; ntaps < range; ntaps++) { + event = libinput_get_event(li); + ptrev = litest_is_button_event(event, + BTN_LEFT, +-- +2.4.3 + diff --git a/libinput.spec b/libinput.spec index e0d5ed6..3ead963 100644 --- a/libinput.spec +++ b/libinput.spec @@ -5,7 +5,7 @@ Name: libinput Version: 1.0.1 -Release: 2%{?gitdate:.%{gitdate}git%{gitversion}}%{?dist} +Release: 3%{?gitdate:.%{gitdate}git%{gitversion}}%{?dist} Summary: Input device library License: MIT @@ -24,6 +24,9 @@ Patch01: 0001-touchpad-serial-synaptics-need-to-fake-new-touches-o.patch # Bug 1256045 - Libinput regularly interprets two-finger scrolling as right-mouse click Patch02: 0001-touchpad-don-t-tap-for-2fg-down-followed-by-a-single.patch +# fdo Bug 92016 - Multi-tap-and-drag sends one too many clicks +Patch03: 0001-touchpad-fix-the-number-of-button-clicks-in-multitap.patch + BuildRequires: git BuildRequires: autoconf automake libtool pkgconfig BuildRequires: libevdev-devel @@ -100,6 +103,9 @@ find $RPM_BUILD_ROOT -name '*.la' -delete %changelog +* Sat Sep 19 2015 Peter Hutterer 1.0.1-3 +- Fix the number of clicks sent in multitap (fdo #92016) + * Mon Sep 07 2015 Peter Hutterer 1.0.1-2 - Don't interpret short scrolls as right click (#1256045)