[PATCH libinput] udev: only apply default calibration on absolute devices

Peter Hutterer peter.hutterer at who-t.net
Thu Dec 4 19:46:07 PST 2014


Fixes a crash if the LIBINPUT_CALIBRATION_MATRIX is set for a relative
device.

https://bugs.freedesktop.org/show_bug.cgi?id=86993

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 src/udev-seat.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/udev-seat.c b/src/udev-seat.c
index f7a3df3..3d05733 100644
--- a/src/udev-seat.c
+++ b/src/udev-seat.c
@@ -93,7 +93,8 @@ device_added(struct udev_device *udev_device,
 		udev_device_get_property_value(udev_device,
 					       "LIBINPUT_CALIBRATION_MATRIX");
 
-	if (calibration_values && sscanf(calibration_values,
+	if (device->abs.absinfo_x && device->abs.absinfo_y &&
+	    calibration_values && sscanf(calibration_values,
 					 "%f %f %f %f %f %f",
 					 &calibration[0],
 					 &calibration[1],
-- 
2.1.0



More information about the wayland-devel mailing list