mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-02-04 04:40:25 +01:00
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 <peter.hutterer@who-t.net>
This commit is contained in:
parent
96fd84ebc9
commit
b1ddd1effe
1 changed files with 6 additions and 8 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue