From 9ce068e760e1282183c7aa1b4cc6b0fcb6b494dd Mon Sep 17 00:00:00 2001 From: Chase Douglas Date: Thu, 24 May 2012 10:48:38 -0700 Subject: 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 Signed-off-by: Peter Hutterer --- src/evdev.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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)) { -- cgit v1.2.3