mirror of
https://github.com/X11Libre/xf86-input-evdev.git
synced 2026-03-24 01:34:04 +00:00
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>
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user