From 415b6ffa958e3103eeb52af4ccd881497169eed4 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 20 Aug 2009 11:02:31 +1000 Subject: 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 Signed-off-by: Peter Hutterer --- src/evdev.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/evdev.c') diff --git a/src/evdev.c b/src/evdev.c index 98f2f1b..5da8960 100644 --- a/src/evdev.c +++ b/src/evdev.c @@ -1804,8 +1804,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; } -- cgit v1.2.3