[PATCH weston 11/17] evdev: query position ranges for MT, too

Pekka Paalanen ppaalanen at gmail.com
Thu Jul 5 03:33:08 PDT 2012


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 at gmail.com>
---
 src/evdev.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/src/evdev.c b/src/evdev.c
index 185f767..d648c17 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -412,6 +412,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;
-- 
1.7.8.6



More information about the wayland-devel mailing list