Always init axis mapping for the first two rel axes (#59784)

Fixes regression introduced in 2f67509b53.

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 <http://bugs.freedesktop.org/show_bug.cgi?id=59784>

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
master
Peter Hutterer 13 years ago
parent bb9b4146cb
commit 2b8b0df62e
  1. 5
      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);

Loading…
Cancel
Save