From 65a366de895f203b717e69ee2c3232cbbd2a5a10 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 9 Apr 2015 07:53:33 +1000 Subject: [PATCH] Fix finger miscounts on single-touch touchpads (#1209151) --- ...ake-finger-processing-until-the-EV_S.patch | 66 +++++++++++++++++++ libinput.spec | 6 +- 2 files changed, 71 insertions(+), 1 deletion(-) create mode 100644 0001-touchpad-delay-fake-finger-processing-until-the-EV_S.patch diff --git a/0001-touchpad-delay-fake-finger-processing-until-the-EV_S.patch b/0001-touchpad-delay-fake-finger-processing-until-the-EV_S.patch new file mode 100644 index 0000000..2cd156a --- /dev/null +++ b/0001-touchpad-delay-fake-finger-processing-until-the-EV_S.patch @@ -0,0 +1,66 @@ +From 82dc1fae18038d04506e154fb36af66bc66c8960 Mon Sep 17 00:00:00 2001 +From: Peter Hutterer +Date: Wed, 8 Apr 2015 17:00:50 +1000 +Subject: [PATCH libinput] touchpad: delay fake finger processing until the + EV_SYN + +A switch from BTN_TOOL_FINGER to BTN_TOOL_DOUBLETAP sets the former to 0, then +the latter to 1, within the same frame. In the previous code we'd end the +first touchpoint, then start two new ones immediately after when the DOUBLETAP +comes in. This causes bug notices in the edge scrolling code and finger +miscounts in the tapping code (since neither processes the change, there is no +SYN_REPORT between the two). + +Only update the state bits when we get the events, handle the fake touch +sequence start/end on SYN_REPORT instead. + +https://bugs.freedesktop.org/show_bug.cgi?id=89949 + +Signed-off-by: Peter Hutterer +--- + src/evdev-mt-touchpad.c | 10 ++++------ + 1 file changed, 4 insertions(+), 6 deletions(-) + +diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c +index 7d6d838..724fd32 100644 +--- a/src/evdev-mt-touchpad.c ++++ b/src/evdev-mt-touchpad.c +@@ -317,16 +317,13 @@ tp_process_absolute_st(struct tp_dispatch *tp, + } + + static void +-tp_process_fake_touch(struct tp_dispatch *tp, +- const struct input_event *e, +- uint64_t time) ++tp_process_fake_touches(struct tp_dispatch *tp, ++ uint64_t time) + { + struct tp_touch *t; + unsigned int nfake_touches; + unsigned int i, start; + +- tp_fake_finger_set(tp, e->code, e->value != 0); +- + nfake_touches = tp_fake_finger_count(tp); + + start = tp->has_mt ? tp->real_touches : 0; +@@ -390,7 +387,7 @@ tp_process_key(struct tp_dispatch *tp, + case BTN_TOOL_DOUBLETAP: + case BTN_TOOL_TRIPLETAP: + case BTN_TOOL_QUADTAP: +- tp_process_fake_touch(tp, e, time); ++ tp_fake_finger_set(tp, e->code, !!e->value); + break; + case BTN_0: + case BTN_1: +@@ -548,6 +545,7 @@ tp_process_state(struct tp_dispatch *tp, uint64_t time) + struct tp_touch *first = tp_get_touch(tp, 0); + unsigned int i; + ++ tp_process_fake_touches(tp, time); + tp_unhover_touches(tp, time); + + for (i = 0; i < tp->ntouches; i++) { +-- +2.3.4 + diff --git a/libinput.spec b/libinput.spec index 66eda63..1b85bcf 100644 --- a/libinput.spec +++ b/libinput.spec @@ -5,7 +5,7 @@ Name: libinput Version: 0.13.0 -Release: 3%{?gitdate:.%{gitdate}git%{gitversion}}%{?dist} +Release: 4%{?gitdate:.%{gitdate}git%{gitversion}}%{?dist} Summary: Input device library License: MIT @@ -21,6 +21,7 @@ Source0: http://www.freedesktop.org/software/libinput/libinput-%{version} Patch01: 0001-evdev-fix-crash-for-missing-ABS_X-Y.patch Patch02: 0002-evdev-fix-handling-of-fake-MT-devices-without-ABS_X-.patch Patch03: 0001-evdev-fix-inverted-mouse-normalization.patch +Patch04: 0001-touchpad-delay-fake-finger-processing-until-the-EV_S.patch BuildRequires: git BuildRequires: autoconf automake libtool pkgconfig @@ -88,6 +89,9 @@ find $RPM_BUILD_ROOT -name '*.la' -delete %changelog +* Thu Apr 09 2015 Peter Hutterer 0.13.0-4 +- Fix finger miscounts on single-touch touchpads (#1209151) + * Wed Apr 08 2015 Peter Hutterer 0.13.0-3 - Fix mouse slowdown (#1208992)