fix tpouchpad as well

This commit is contained in:
grant2258 2018-12-12 18:27:29 +00:00
parent 1d8dd133b7
commit fd6856ce20
1 changed files with 3 additions and 19 deletions

View File

@ -505,25 +505,9 @@ static bool udev_input_add_device(udev_input_t *udev,
strlcpy(device->devnode, devnode, sizeof(device->devnode)); 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 */ /* 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) 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; device->mouse.y_min = absinfo.maximum;
} }
} }
} }
tmp = ( udev_input_device_t**)realloc(udev->devices, tmp = ( udev_input_device_t**)realloc(udev->devices,
(udev->num_devices + 1) * sizeof(*udev->devices)); (udev->num_devices + 1) * sizeof(*udev->devices));