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-07-30 09:44:33 +1000
commit1432b5153ec2666845c2017eedc3c166fd8c8e3c (patch)
tree4835d7342700ecdb7d8e82f03fde16859e613559
parentEnsure enough buttons are advertised to pass the button mapping. (diff)
downloadxf86-input-evdev-1432b5153ec2666845c2017eedc3c166fd8c8e3c.tar.gz
xf86-input-evdev-1432b5153ec2666845c2017eedc3c166fd8c8e3c.tar.bz2
xf86-input-evdev-1432b5153ec2666845c2017eedc3c166fd8c8e3c.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> (cherry picked from commit 255b9f6bbf374a315750019c6fadc5f82fb7d41d)
-rw-r--r--src/evdev.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/evdev.c b/src/evdev.c
index a9e1d27..b880c6a 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -1095,9 +1095,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->buttons, pEvdev->btnmap))
return !Success;
return Success;