From dd3a14f13c21277e81c1e9c9c309a4e5b6924351 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 12 Jan 2012 11:03:30 +1000 Subject: [PATCH] Force REL_X/REL_Y to exist on devices with any relative axes (#44655) Too much in the server relies on x/y to exist and to be axes 0 and 1. Since smooth scrolling we initialise wheels as axes too, so if any relative axes exist, initialize REL_X/Y as well. For servers up to 1.11: a scrollwheel-only device now has relative axes where it only had buttons before. For servers 1.12 or later: the device now has x/y in addition to the scroll axes. X.Org Bug 44655 Signed-off-by: Peter Hutterer --- src/evdev.c | 11 +++++++++++ 1 files changed, 11 insertions(+), 0 deletions(-) diff --git a/src/evdev.c b/src/evdev.c index 86a9e55..77609fb 100644 --- a/src/evdev.c +++ b/src/evdev.c @@ -2052,6 +2052,17 @@ EvdevProbe(InputInfoPtr pInfo) pEvdev->num_buttons = num_buttons; } + /* Some devices only have other rel axes (e.g. wheels), but we + * still need x/y for these. The server relies on devices having + * x/y as axes 0/1 and core/XI 1.x clients expect it too (#44655) */ + if (!EvdevBitIsSet(pEvdev->rel_bitmask, REL_X) || + !EvdevBitIsSet(pEvdev->rel_bitmask, REL_Y)) + { + xf86IDrvMsg(pInfo, X_INFO, "Forcing x/y axes to exist.\n"); + EvdevSetBit(pEvdev->rel_bitmask, REL_X); + EvdevSetBit(pEvdev->rel_bitmask, REL_Y); + } + if (!ignore_rel) { xf86IDrvMsg(pInfo, X_PROBED, "Found relative axes\n"); -- 1.7.7.5