From eea88881535a6f3625f86fb7ddfebe6945ea7c85 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Mon, 23 Oct 2017 15:30:41 +1000 Subject: [PATCH] touchpad: cap the edge palm detection zones at 8mm The main purpose of the edge zone is to detect palms in the area where we cannot assume a full finger size and thus cannot use any other palm detection mechanism. 8mm should be large enough that a finger should be detected based on other properties (size, pressure, ...). https://bugs.freedesktop.org/show_bug.cgi?id=103330 Signed-off-by: Peter Hutterer (cherry picked from commit ed52002c8ddeac218ae88231d5a8f759f8733266) --- src/evdev-mt-touchpad.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c index c0a78255..ab21536e 100644 --- a/src/evdev-mt-touchpad.c +++ b/src/evdev-mt-touchpad.c @@ -2294,11 +2294,11 @@ tp_init_palmdetect_edge(struct tp_dispatch *tp, return; /* palm edges are 8% of the width on each side */ - mm.x = width * 0.08; + mm.x = min(8, width * 0.08); edges = evdev_device_mm_to_units(device, &mm); tp->palm.left_edge = edges.x; - mm.x = width * 0.92; + mm.x = width - min(8, width * 0.08); edges = evdev_device_mm_to_units(device, &mm); tp->palm.right_edge = edges.x; }