mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-01-09 13:20:24 +01:00
evdev: query position ranges for MT, too
For a true multi-touch input device, the code ended up using uninitialised fields of evdev_input_device::abs. Fix it by querying the corresponding MT ranges. Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
This commit is contained in:
parent
19b5a3707a
commit
701024fd90
1 changed files with 8 additions and 0 deletions
|
|
@ -400,6 +400,14 @@ evdev_configure_device(struct evdev_input_device *device)
|
|||
device->caps |= EVDEV_MOTION_ABS;
|
||||
}
|
||||
if (TEST_BIT(abs_bits, ABS_MT_SLOT)) {
|
||||
ioctl(device->fd, EVIOCGABS(ABS_MT_POSITION_X),
|
||||
&absinfo);
|
||||
device->abs.min_x = absinfo.minimum;
|
||||
device->abs.max_x = absinfo.maximum;
|
||||
ioctl(device->fd, EVIOCGABS(ABS_MT_POSITION_Y),
|
||||
&absinfo);
|
||||
device->abs.min_y = absinfo.minimum;
|
||||
device->abs.max_y = absinfo.maximum;
|
||||
device->is_mt = 1;
|
||||
device->mt.slot = 0;
|
||||
device->caps |= EVDEV_TOUCH;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue