mirror of
https://github.com/X11Libre/xf86-input-evdev.git
synced 2026-03-25 10:19:22 +00:00
Fix absolute axis labelling - mapping must be initialized before the labels.
88eedea281added axis labelling to the valuator initialization. This requires the axis mapping to be established before the absolute axis labels are initialized.88eedeadid this for relative axes, but missed out on the absolute ones. As a result, all abs. labels were initialized to "None". Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
22
src/evdev.c
22
src/evdev.c
@@ -1016,6 +1016,14 @@ EvdevAddAbsClass(DeviceIntPtr device)
|
||||
memset(pEvdev->old_vals, -1, num_axes * sizeof(int));
|
||||
atoms = xalloc(pEvdev->num_vals * sizeof(Atom));
|
||||
|
||||
for (axis = ABS_X; axis <= ABS_MAX; axis++) {
|
||||
pEvdev->axis_map[axis] = -1;
|
||||
if (!TestBit(axis, pEvdev->abs_bitmask))
|
||||
continue;
|
||||
pEvdev->axis_map[axis] = i;
|
||||
i++;
|
||||
}
|
||||
|
||||
EvdevInitAxesLabels(pEvdev, pEvdev->num_vals, atoms);
|
||||
|
||||
if (!InitValuatorClassDeviceStruct(device, num_axes,
|
||||
@@ -1029,20 +1037,18 @@ EvdevAddAbsClass(DeviceIntPtr device)
|
||||
return !Success;
|
||||
|
||||
for (axis = ABS_X; axis <= ABS_MAX; axis++) {
|
||||
pEvdev->axis_map[axis] = -1;
|
||||
if (!TestBit(axis, pEvdev->abs_bitmask))
|
||||
int axnum = pEvdev->axis_map[axis];
|
||||
if (axnum == -1)
|
||||
continue;
|
||||
pEvdev->axis_map[axis] = i;
|
||||
xf86InitValuatorAxisStruct(device, i,
|
||||
xf86InitValuatorAxisStruct(device, axnum,
|
||||
#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
|
||||
atoms[i],
|
||||
atoms[axnum],
|
||||
#endif
|
||||
pEvdev->absinfo[axis].minimum,
|
||||
pEvdev->absinfo[axis].maximum,
|
||||
10000, 0, 10000);
|
||||
xf86InitValuatorDefaults(device, i);
|
||||
pEvdev->old_vals[i] = -1;
|
||||
i++;
|
||||
xf86InitValuatorDefaults(device, axnum);
|
||||
pEvdev->old_vals[axnum] = -1;
|
||||
}
|
||||
|
||||
xfree(atoms);
|
||||
|
||||
Reference in New Issue
Block a user