summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2009-08-20 11:02:31 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2009-08-20 11:10:13 +1000
commitc8a0f1cf362152ae275717d367afa2179d6bbc0b (patch)
tree4079ef64518680e39a74dc43f499cd30a91ee477
parentbf356d939925b537921e1f82559f92baa3a76bcc (diff)
downloadxorg-driver-xf86-input-evdev-c8a0f1cf362152ae275717d367afa2179d6bbc0b.tar.gz
Only take the driver-internal button mapping to count buttons (#23405)
Regression: If a user has multiple buttons mapped to the same button number, the number of buttons counted is set to a wrong value. e.g. a button mapping of 1 1 1 for a mouse with three buttons would only initialize 1 button to the X server. In the future, the user cannot change this button mapping as the server only knows about one button. The user-supplied button map (option ButtonMapping) shouldn't matter when counting the buttons. Only the driver-internal mapping (BTN_0 -> button 1, etc.) matters. X.Org Bug 23405 <http://bugs.freedesktop.org/show_bug.cgi?id=23405> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> (cherry picked from commit 415b6ffa958e3103eeb52af4ccd881497169eed4)
-rw-r--r--src/evdev.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/evdev.c b/src/evdev.c
index 9f330e3..85ed233 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -1544,8 +1544,7 @@ EvdevProbe(InputInfoPtr pInfo)
int mapping = 0;
if (TestBit(i, pEvdev->key_bitmask))
{
- mapping =
- pEvdev->btnmap[EvdevUtilButtonEventToButtonNumber(pEvdev, i)];
+ mapping = EvdevUtilButtonEventToButtonNumber(pEvdev, i);
if (mapping > num_buttons)
num_buttons = mapping;
}