summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2013-04-29 11:48:12 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2013-05-01 15:05:43 +1000
commitdea1d1a3906b98b491e9760b3304f881c6afec5e (patch)
treef81fc35a3e56adf2cb0806c511a02f4af212394d
parentb59a1a25dad4437e013ce8d3d65d4591c6f4ee4a (diff)
Fail to set up axes for devices that only have MT axes but no ABS_X/Y equivalents (#64029)
The kernel should give us ABS_X/Y for backwards compat but some devices don't. For now, ignore these devices as evdev is not suited to handle this yet and will crash if a device is set up without axes (i.e. pEvdev->vals == NULL) and later receives an event from an MT axis. X.Org Bug 64029 <http://bugs.freedesktop.org/show_bug.cgi?id=64029> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
-rw-r--r--src/evdev.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/evdev.c b/src/evdev.c
index 94f5499..aec1447 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -1283,6 +1283,15 @@ EvdevAddAbsValuatorClass(DeviceIntPtr device, int want_scroll_axes)
num_axes--;
}
}
+
+ /* device only has mt-axes. the kernel should give us ABS_X etc for
+ backwards compat but some devices don't have it. */
+ if (num_axes == 0 && num_mt_axes > 0) {
+ xf86IDrvMsg(pInfo, X_ERROR,
+ "found only multitouch-axes. That shouldn't happen.\n");
+ goto out;
+ }
+
#endif
#ifdef HAVE_SMOOTH_SCROLLING