mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-02-05 12:10:28 +01:00
tablet: fix check for rotation axis
Only the cursor tool has rotation encoded as tilt, so if we don't have the mouse tool we don't have rotation. We still need to check for ABS_Z separately though. Crashes Waltop tablets that have tilt x/y but no cursor/lens tool. We'd thus never hit the rotation-z condition in tablet_check_notify_axes() and eventually try to dereference a non-existing ABS_Z axis. https://bugs.freedesktop.org/show_bug.cgi?id=90885 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
e5fe164bcf
commit
2776581d08
1 changed files with 7 additions and 0 deletions
|
|
@ -77,11 +77,18 @@ tablet_device_has_axis(struct tablet_dispatch *tablet,
|
|||
|
||||
if (axis == LIBINPUT_TABLET_AXIS_ROTATION_Z) {
|
||||
has_axis = (libevdev_has_event_code(evdev,
|
||||
EV_KEY,
|
||||
BTN_TOOL_MOUSE) &&
|
||||
libevdev_has_event_code(evdev,
|
||||
EV_ABS,
|
||||
ABS_TILT_X) &&
|
||||
libevdev_has_event_code(evdev,
|
||||
EV_ABS,
|
||||
ABS_TILT_Y));
|
||||
code = axis_to_evcode(axis);
|
||||
has_axis |= libevdev_has_event_code(evdev,
|
||||
EV_ABS,
|
||||
code);
|
||||
} else if (axis == LIBINPUT_TABLET_AXIS_REL_WHEEL) {
|
||||
has_axis = libevdev_has_event_code(evdev,
|
||||
EV_REL,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue