Fix palm threshold on MacBookPro5,5 (#1575260)

This commit is contained in:
Peter Hutterer 2018-05-14 11:09:10 +10:00
parent f11bd4ba52
commit ea254a5f10
3 changed files with 88 additions and 1 deletions

View File

@ -0,0 +1,29 @@
From 7ce9766162ee30e54eba544d9d83650e1c313d79 Mon Sep 17 00:00:00 2001
From: Veli-Jussi Raitila <vjr@iki.fi>
Date: Fri, 11 May 2018 12:26:16 +0300
Subject: [PATCH libinput] Add quirk to fix spurious palm detections on MacBook
Pro (13-inch, Mid 2009)
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
---
udev/90-libinput-model-quirks.hwdb | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/udev/90-libinput-model-quirks.hwdb b/udev/90-libinput-model-quirks.hwdb
index dd5ae4d9..d5d47682 100644
--- a/udev/90-libinput-model-quirks.hwdb
+++ b/udev/90-libinput-model-quirks.hwdb
@@ -74,6 +74,10 @@ libinput:touchpad:input:b0005v05ACp030E*
libinput:touchpad:input:b0003v05ACp021A*
LIBINPUT_MODEL_APPLE_TOUCHPAD_ONEBUTTON=1
+# MacBookPro5,5 (Mid 2009)
+libinput:name:bcm5974:dmi:*:svnAppleInc.:pnMacBookPro5,5:*
+ LIBINPUT_ATTR_PALM_SIZE_THRESHOLD=1000
+
##########################################
# Asus
##########################################
--
2.14.3

View File

@ -0,0 +1,53 @@
From 59eb10e593213403c301a5ce3fbd0a22b6e52efd Mon Sep 17 00:00:00 2001
From: Peter Hutterer <peter.hutterer@who-t.net>
Date: Mon, 30 Apr 2018 10:40:45 +1000
Subject: [PATCH libinput] util: allow for palm pressure > 255
https://bugs.freedesktop.org/show_bug.cgi?id=105753
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
---
src/libinput-util.c | 4 +---
test/test-misc.c | 3 +--
2 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/src/libinput-util.c b/src/libinput-util.c
index 93d73827..e774fb78 100644
--- a/src/libinput-util.c
+++ b/src/libinput-util.c
@@ -425,9 +425,7 @@ parse_palm_pressure_property(const char *prop)
if (!prop)
return 0;
- if (!safe_atoi(prop, &threshold) ||
- threshold < 0 ||
- threshold > 255) /* No touchpad device has pressure > 255 */
+ if (!safe_atoi(prop, &threshold) || threshold < 0)
return 0;
return threshold;
diff --git a/test/test-misc.c b/test/test-misc.c
index c62cd03e..608bba61 100644
--- a/test/test-misc.c
+++ b/test/test-misc.c
@@ -1055,16 +1055,15 @@ START_TEST(palm_pressure_parser)
{ "1", 1 },
{ "10", 10 },
{ "255", 255 },
+ { "360", 360 },
{ "-12", 0 },
- { "360", 0 },
{ "0", 0 },
{ "-0", 0 },
{ "a", 0 },
{ "10a", 0 },
{ "10-", 0 },
{ "sadfasfd", 0 },
- { "361", 0 },
{ NULL, 0 }
};
--
2.14.3

View File

@ -5,7 +5,7 @@
Name: libinput
Version: 1.10.6
Release: 1%{?gitdate:.%{gitdate}git%{gitversion}}%{?dist}
Release: 2%{?gitdate:.%{gitdate}git%{gitversion}}%{?dist}
Summary: Input device library
License: MIT
@ -19,6 +19,8 @@ Source0: http://www.freedesktop.org/software/libinput/libinput-%{version}
%endif
Patch02: 0001-touchpad-fix-the-trackpoint-event-counter-for-the-T4.patch
Patch03: 0001-util-allow-for-palm-pressure-255.patch
Patch04: 0001-Add-quirk-to-fix-spurious-palm-detections-on-MacBook.patch
BuildRequires: git-core
BuildRequires: gcc gcc-c++
@ -111,6 +113,9 @@ The %{name}-utils package contains tools to debug hardware and analyze
%{_mandir}/man1/libinput-measure-trackpoint-range.1*
%changelog
* Mon May 14 2018 Peter Hutterer <peter.hutterer@redhat.com> 1.10.6-2
- Fix palm threshold on MacBookPro5,5 (#1575260)
* Tue May 01 2018 Peter Hutterer <peter.hutterer@redhat.com> 1.10.6-1
- libinput 1.10.6