evdev: don't return a size for 0-1 axes

Tablet pads historically need to have ABS_X/Y to be detected as tablets
but their min/max values are 0 and 1. Let's not return a size for those.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1004>
This commit is contained in:
Peter Hutterer 2024-05-27 14:25:17 +10:00
parent e802715785
commit fe3175748a

View file

@ -2725,6 +2725,10 @@ evdev_device_get_size(const struct evdev_device *device,
x = libevdev_get_abs_info(device->evdev, ABS_X);
y = libevdev_get_abs_info(device->evdev, ABS_Y);
if ((x && x->minimum == 0 && x->maximum == 1) ||
(y && y->minimum == 0 && y->maximum == 1))
return -1;
if (!x || !y || device->abs.is_fake_resolution ||
!x->resolution || !y->resolution)
return -1;