From 2b8b0df62ec554952784f2820fb4143c495232b0 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 24 Jan 2013 16:18:48 +1000 Subject: Always init axis mapping for the first two rel axes (#59784) Fixes regression introduced in 2f67509b53b27dd7f51ca2aadd19605aee613a61. If evdev is used for touchpads, the abs axis movement is converted to a rel movement. Without the two relative axes initialized, the events are discarded. Axes 0 and 1 are always x/y anyway unless specifically configured otherwise. X.Org Bug 59784 Signed-off-by: Peter Hutterer --- src/evdev.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/evdev.c b/src/evdev.c index 570dd06..731ebb3 100644 --- a/src/evdev.c +++ b/src/evdev.c @@ -2576,6 +2576,9 @@ EvdevAlloc(void) for (i = 0; i < ArrayLength(pEvdev->abs_axis_map); i++) pEvdev->abs_axis_map[i] = -1; + pEvdev->rel_axis_map[0] = 0; + pEvdev->rel_axis_map[1] = 1; + return pEvdev; } @@ -2740,6 +2743,8 @@ static void EvdevInitAxesLabels(EvdevPtr pEvdev, int mode, int natoms, Atom *ato memset(atoms, 0, natoms * sizeof(Atom)); + /* rel[0] and [1] are always mapped, so we get the rel labels. if we + have abs x/y, the labels will be overwritten with the right one */ for (axis = 0; axis < ArrayLength(rel_labels); axis++) EvdevInitOneAxisLabel(pEvdev, pEvdev->rel_axis_map[axis], rel_labels, axis, atoms); -- cgit v1.2.3