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>
(cherry picked from commit 9ce068e760)
This commit is contained in:
Chase Douglas
2012-05-24 10:48:38 -07:00
committed by Peter Hutterer
parent 833fc517d7
commit 7749159241

View File

@@ -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)) {