Fix finger miscounts on single-touch touchpads (#1209151)

This commit is contained in:
Peter Hutterer 2015-04-09 07:53:33 +10:00
parent 3164021ea1
commit 65a366de89
2 changed files with 71 additions and 1 deletions

View File

@ -0,0 +1,66 @@
From 82dc1fae18038d04506e154fb36af66bc66c8960 Mon Sep 17 00:00:00 2001
From: Peter Hutterer <peter.hutterer@who-t.net>
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 <peter.hutterer@who-t.net>
---
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

View File

@ -5,7 +5,7 @@
Name: libinput Name: libinput
Version: 0.13.0 Version: 0.13.0
Release: 3%{?gitdate:.%{gitdate}git%{gitversion}}%{?dist} Release: 4%{?gitdate:.%{gitdate}git%{gitversion}}%{?dist}
Summary: Input device library Summary: Input device library
License: MIT 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 Patch01: 0001-evdev-fix-crash-for-missing-ABS_X-Y.patch
Patch02: 0002-evdev-fix-handling-of-fake-MT-devices-without-ABS_X-.patch Patch02: 0002-evdev-fix-handling-of-fake-MT-devices-without-ABS_X-.patch
Patch03: 0001-evdev-fix-inverted-mouse-normalization.patch Patch03: 0001-evdev-fix-inverted-mouse-normalization.patch
Patch04: 0001-touchpad-delay-fake-finger-processing-until-the-EV_S.patch
BuildRequires: git BuildRequires: git
BuildRequires: autoconf automake libtool pkgconfig BuildRequires: autoconf automake libtool pkgconfig
@ -88,6 +89,9 @@ find $RPM_BUILD_ROOT -name '*.la' -delete
%changelog %changelog
* Thu Apr 09 2015 Peter Hutterer <peter.hutterer@redhat.com> 0.13.0-4
- Fix finger miscounts on single-touch touchpads (#1209151)
* Wed Apr 08 2015 Peter Hutterer <peter.hutterer@redhat.com> 0.13.0-3 * Wed Apr 08 2015 Peter Hutterer <peter.hutterer@redhat.com> 0.13.0-3
- Fix mouse slowdown (#1208992) - Fix mouse slowdown (#1208992)