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; }