diff --git a/input/drivers/udev_input.c b/input/drivers/udev_input.c index b4eef0ce8d..f3b61a8b4d 100644 --- a/input/drivers/udev_input.c +++ b/input/drivers/udev_input.c @@ -505,25 +505,9 @@ static bool udev_input_add_device(udev_input_t *udev, strlcpy(device->devnode, devnode, sizeof(device->devnode)); - /* Touchpads report in absolute coords. */ - if (type == UDEV_INPUT_TOUCHPAD) - { - if (ioctl(fd, EVIOCGABS(ABS_X), &absinfo) < 0 || - absinfo.minimum >= absinfo.maximum) - goto error; - - device->mouse.x_min = absinfo.minimum; - device->mouse.x_max = absinfo.maximum; - - if (ioctl(fd, EVIOCGABS(ABS_Y), &absinfo) < 0 || - absinfo.minimum >= absinfo.maximum) - goto error; - - device->mouse.y_min = absinfo.minimum; - device->mouse.y_max = absinfo.maximum; - } + /* UDEV_INPUT_MOUSE may report in absolute coords too */ - else if (type == UDEV_INPUT_MOUSE) + if (type == UDEV_INPUT_MOUSE || type == UDEV_INPUT_TOUCHPAD ) { if (ioctl(fd, EVIOCGABS(ABS_X), &absinfo) >= 0) { @@ -554,7 +538,7 @@ static bool udev_input_add_device(udev_input_t *udev, device->mouse.y_min = absinfo.maximum; } } - } + } tmp = ( udev_input_device_t**)realloc(udev->devices, (udev->num_devices + 1) * sizeof(*udev->devices));