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-07-04 08:20:55 +1000
commit774915924102c348ce7045ffa07905d1079f447c (patch)
tree4aebb195bfb2399ea7beec3a7bf1d41f8accb02f
parentDevices configured as mice need REL_X/Y (diff)
downloadxf86-input-evdev-774915924102c348ce7045ffa07905d1079f447c.tar.gz
xf86-input-evdev-774915924102c348ce7045ffa07905d1079f447c.tar.bz2
xf86-input-evdev-774915924102c348ce7045ffa07905d1079f447c.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> (cherry picked from commit 9ce068e760e1282183c7aa1b4cc6b0fcb6b494dd)
-rw-r--r--src/evdev.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/evdev.c b/src/evdev.c
index 140a633..8527eb3 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)) {