aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2009-05-21 10:23:37 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2009-05-21 15:51:08 +1000
commit255b9f6bbf374a315750019c6fadc5f82fb7d41d (patch)
tree14577972ccfbbfd5eaa77cd120c622579cd3360a
parentRename pEvdev->buttons to pEvdev->num_buttons for clarity. (diff)
downloadxf86-input-evdev-255b9f6bbf374a315750019c6fadc5f82fb7d41d.tar.gz
xf86-input-evdev-255b9f6bbf374a315750019c6fadc5f82fb7d41d.tar.bz2
xf86-input-evdev-255b9f6bbf374a315750019c6fadc5f82fb7d41d.zip
Only initialize the number of buttons we actually have.
This takes into account driver-configured button mappings, i.e. if device with one button has this button mapped to 25 through the ButtonMapping option, the X server will think the device has result 25 buttons. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--src/evdev.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/evdev.c b/src/evdev.c
index 9d3409f..6b22a8f 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -1115,9 +1115,7 @@ EvdevAddButtonClass(DeviceIntPtr device)
pInfo = device->public.devicePrivate;
pEvdev = pInfo->private;
- /* FIXME: count number of actual buttons */
- if (!InitButtonClassDeviceStruct(device, ArrayLength(pEvdev->btnmap),
- pEvdev->btnmap))
+ if (!InitButtonClassDeviceStruct(device, pEvdev->num_buttons, pEvdev->btnmap))
return !Success;
return Success;