backend/libinput: handle high-res scroll events

On newer versions of libinput, the event LIBINPUT_EVENT_POINTER_AXIS
has been deprecated in favour of LIBINPUT_EVENT_POINTER_SCROLL_WHEEL,
LIBINPUT_EVENT_POINTER_SCROLL_FINGER and
LIBINPUT_EVENT_POINTER_SCROLL_CONTINUOUS.

Where new events are provided by the backend, ignore
LIBINPUT_EVENT_POINTER_AXIS, receive high-resolution scroll events from
libinput and emit the appropiate wlr_pointer signal.
This commit is contained in:
José Expósito 2022-02-25 17:30:42 +01:00
parent 65c436407f
commit c6032d6b1c
3 changed files with 60 additions and 0 deletions

View file

@ -176,8 +176,25 @@ void handle_libinput_event(struct wlr_libinput_backend *backend,
handle_pointer_button(event, &dev->pointer);
break;
case LIBINPUT_EVENT_POINTER_AXIS:
#if !LIBINPUT_HAS_SCROLL_VALUE120
/* This event must be ignored in favour of the SCROLL_* events */
handle_pointer_axis(event, &dev->pointer);
#endif
break;
#if LIBINPUT_HAS_SCROLL_VALUE120
case LIBINPUT_EVENT_POINTER_SCROLL_WHEEL:
handle_pointer_axis_value120(event, &dev->pointer,
WLR_AXIS_SOURCE_WHEEL);
break;
case LIBINPUT_EVENT_POINTER_SCROLL_FINGER:
handle_pointer_axis_value120(event, &dev->pointer,
WLR_AXIS_SOURCE_FINGER);
break;
case LIBINPUT_EVENT_POINTER_SCROLL_CONTINUOUS:
handle_pointer_axis_value120(event, &dev->pointer,
WLR_AXIS_SOURCE_CONTINUOUS);
break;
#endif
case LIBINPUT_EVENT_TOUCH_DOWN:
handle_touch_down(event, &dev->touch);
break;