mirror of
https://github.com/X11Libre/xf86-input-evdev.git
synced 2026-04-14 11:44:16 +00:00
If a device fails to initialize relative axes, init the abs. axes instead.
Some devices have relative axes that don't count (scroll wheels). In this
case, don't claim we've initialized relative axes, continue with the
absolute axes instead.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit b07ab6ea97)
This commit is contained in:
20
src/evdev.c
20
src/evdev.c
@@ -1061,6 +1061,9 @@ EvdevAddRelClass(DeviceIntPtr device)
|
||||
if (TestBit(REL_DIAL, pEvdev->rel_bitmask))
|
||||
num_axes--;
|
||||
|
||||
if (num_axes <= 0)
|
||||
return !Success;
|
||||
|
||||
pEvdev->num_vals = num_axes;
|
||||
memset(pEvdev->vals, 0, num_axes * sizeof(int));
|
||||
|
||||
@@ -1188,12 +1191,17 @@ EvdevInit(DeviceIntPtr device)
|
||||
FIXME: somebody volunteer to fix this.
|
||||
*/
|
||||
if (pEvdev->flags & EVDEV_RELATIVE_EVENTS) {
|
||||
EvdevAddRelClass(device);
|
||||
if (pEvdev->flags & EVDEV_ABSOLUTE_EVENTS)
|
||||
xf86Msg(X_INFO,"%s: relative axes found, ignoring absolute "
|
||||
"axes.\n", device->name);
|
||||
pEvdev->flags &= ~EVDEV_ABSOLUTE_EVENTS;
|
||||
} else if (pEvdev->flags & EVDEV_ABSOLUTE_EVENTS)
|
||||
if (EvdevAddRelClass(device) == Success)
|
||||
{
|
||||
if (pEvdev->flags & EVDEV_ABSOLUTE_EVENTS)
|
||||
xf86Msg(X_INFO,"%s: relative axes found, ignoring absolute "
|
||||
"axes.\n", device->name);
|
||||
pEvdev->flags &= ~EVDEV_ABSOLUTE_EVENTS;
|
||||
} else
|
||||
pEvdev->flags &= ~EVDEV_RELATIVE_EVENTS;
|
||||
}
|
||||
|
||||
if (pEvdev->flags & EVDEV_ABSOLUTE_EVENTS)
|
||||
EvdevAddAbsClass(device);
|
||||
|
||||
#ifdef HAVE_PROPERTIES
|
||||
|
||||
Reference in New Issue
Block a user