From ccd13c567c8edc09b9edf648050bcc4ad8d35389 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 5 Aug 2009 13:39:34 +1000 Subject: [PATCH] Hack around touchpads with relative axes (#23126) Some touchpads (e.g. Alps) have relative axes and absolute ones. Evdev doesn't handle devices with both axes, choosing to ignore the absolute ones. With the fix to bug 21832, events posted by such touchpads would be dropped. This patch adds a special hack to ignore relative axes on touchpads and set up the absolute axes instead. Other devices are not affected. Approach originally by Michael Witten X.Org Bug 23126 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 9528dbf..4df22f9 100644 --- a/src/evdev.c +++ b/src/evdev.c @@ -1437,6 +1437,17 @@ EvdevInit(DeviceIntPtr device) FIXME: somebody volunteer to fix this. */ + + /* Touchpads always require absolute axes but we post them as relative + ones. This is a hack around this bit of insanity. FIXME: Ideally, we + should also set up the abs axes as relative in the server then + though. */ + if (pEvdev->flags & EVDEV_TOUCHPAD) { + xf86Msg(X_INFO,"%s: touchpad found, ignoring relative axes.\n", + device->name); + pEvdev->flags &= ~EVDEV_RELATIVE_EVENTS; + } + if (pEvdev->flags & EVDEV_RELATIVE_EVENTS) { if (EvdevAddRelClass(device) == Success) { -- 1.6.3.rc1.2.g0164.dirty