Only edge scroll when the finger is on the actual edge

This commit is contained in:
Peter Hutterer 2015-07-14 09:47:06 +10:00
parent f91e7233fc
commit 8ed156bd58
2 changed files with 40 additions and 1 deletions

View File

@ -0,0 +1,35 @@
From 0d320c87c99e93b2feb1703f5bfd5d4fcc0a2857 Mon Sep 17 00:00:00 2001
From: Peter Hutterer <peter.hutterer@who-t.net>
Date: Mon, 13 Jul 2015 14:14:42 +1000
Subject: [PATCH libinput] touchpad: only edge-scroll while the finger is in
the edge area
When the touch leaves the area for edge scrolling after starting to scroll,
discard any movement. This signals to the user that they've left the area and
forces them to lift the finger to switch back to motion. If the finger moves
back into the area, scrolling continues.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
---
src/evdev-mt-touchpad-edge-scroll.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/evdev-mt-touchpad-edge-scroll.c b/src/evdev-mt-touchpad-edge-scroll.c
index ca9ef4a..4f8362c 100644
--- a/src/evdev-mt-touchpad-edge-scroll.c
+++ b/src/evdev-mt-touchpad-edge-scroll.c
@@ -384,6 +384,11 @@ tp_edge_scroll_post_events(struct tp_dispatch *tp, uint64_t time)
if (t->palm.state != PALM_NONE)
continue;
+ /* only scroll with the finger in the previous edge */
+ if (t->scroll.edge &&
+ (tp_touch_get_edge(tp, t) & t->scroll.edge) == 0)
+ continue;
+
switch (t->scroll.edge) {
case EDGE_NONE:
if (t->scroll.direction != -1) {
--
2.4.3

View File

@ -5,7 +5,7 @@
Name: libinput
Version: 0.19.0
Release: 2%{?gitdate:.%{gitdate}git%{gitversion}}%{?dist}
Release: 3%{?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-test-move-enable_edge_scroll-up.patch
Patch02: 0002-test-add-helper-function-for-enabling-click-methods.patch
Patch03: 0003-touchpad-allow-edge-scrolling-on-clickpads.patch
Patch04: 0001-touchpad-only-edge-scroll-while-the-finger-is-in-the.patch
BuildRequires: git
BuildRequires: autoconf automake libtool pkgconfig
@ -98,6 +99,9 @@ find $RPM_BUILD_ROOT -name '*.la' -delete
%changelog
* Tue Jul 14 2015 Peter Hutterer <peter.hutterer@redhat.com> 0.19.0-3
- Only edge scroll when the finger is on the actual edge
* Thu Jul 09 2015 Peter Hutterer <peter.hutterer@redhat.com> 0.19.0-2
- enable edge scrolling on clickpads (#1225579)