From 59eb10e593213403c301a5ce3fbd0a22b6e52efd Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Mon, 30 Apr 2018 10:40:45 +1000 Subject: [PATCH] util: allow for palm pressure > 255 https://bugs.freedesktop.org/show_bug.cgi?id=105753 Signed-off-by: Peter Hutterer --- 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 } };