From b1ddd1effe0bed6993571d7a56cb9fd9d2363996 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 7 Feb 2018 15:01:31 +1000 Subject: [PATCH] touchpad: init touch size range based on the udev property No need to hardcode Apple here, if we have a udev property for this, let's use it. Signed-off-by: Peter Hutterer --- src/evdev-mt-touchpad.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c index 833e5c99..c649db54 100644 --- a/src/evdev-mt-touchpad.c +++ b/src/evdev-mt-touchpad.c @@ -3174,17 +3174,17 @@ tp_init_touch_size(struct tp_dispatch *tp, return false; } + prop = udev_device_get_property_value(device->udev_device, + "LIBINPUT_ATTR_TOUCH_SIZE_RANGE"); + if (!prop) + return false; + if (libevdev_get_num_slots(device->evdev) < 5) { evdev_log_bug_libinput(device, "Expected 5+ slots for touch size detection\n"); return false; } - prop = udev_device_get_property_value(device->udev_device, - "LIBINPUT_ATTR_TOUCH_SIZE_RANGE"); - if (!prop) - return false; - if (!parse_range_property(prop, &hi, &lo)) { evdev_log_bug_client(device, "discarding invalid touch size range '%s'\n", @@ -3227,9 +3227,7 @@ tp_init(struct tp_dispatch *tp, return false; evdev_device_init_abs_range_warnings(device); - - if (device->model_flags & EVDEV_MODEL_APPLE_TOUCHPAD) - use_touch_size = tp_init_touch_size(tp, device); + use_touch_size = tp_init_touch_size(tp, device); if (!use_touch_size) tp_init_pressure(tp, device);