aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChase Douglas <chase.douglas@canonical.com>2012-05-24 10:48:38 -0700
committerPeter Hutterer <peter.hutterer@who-t.net>2012-05-25 09:33:52 +1000
commit9ce068e760e1282183c7aa1b4cc6b0fcb6b494dd (patch)
treef5780b705e6e5f79e91023f870f41c9187093166
parentFix some obvious constness-related compile warnings. (diff)
downloadxf86-input-evdev-9ce068e760e1282183c7aa1b4cc6b0fcb6b494dd.tar.gz
xf86-input-evdev-9ce068e760e1282183c7aa1b4cc6b0fcb6b494dd.tar.bz2
xf86-input-evdev-9ce068e760e1282183c7aa1b4cc6b0fcb6b494dd.zip
Report the correct number of touches for MT protocol B devices
Protocol B devices report the number of touches by giving a maximum and minimum slot value. The current code ignores the minimum value, which is usually 0, and underreports the number of touches by 1. Signed-off-by: Chase Douglas <chase.douglas@canonical.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--src/evdev.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/evdev.c b/src/evdev.c
index feb018c..4b86f66 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -1384,7 +1384,8 @@ EvdevAddAbsValuatorClass(DeviceIntPtr device)
XIDependentTouch : XIDirectTouch;
if (pEvdev->mtdev->caps.slot.maximum > 0)
- num_touches = pEvdev->mtdev->caps.slot.maximum;
+ num_touches = pEvdev->mtdev->caps.slot.maximum -
+ pEvdev->mtdev->caps.slot.minimum + 1;
if (!InitTouchClassDeviceStruct(device, num_touches, mode,
num_mt_axes_total)) {