aboutsummaryrefslogtreecommitdiff
path: root/backend/libinput/events.c
diff options
context:
space:
mode:
authorJosé Expósito <jose.exposito89@gmail.com>2022-02-25 17:30:42 +0100
committerJosé Expósito <jose.exposito89@gmail.com>2022-07-11 11:01:35 +0200
commitc6032d6b1cc1cfb884924bb8afbdd200c3258d9a (patch)
tree2a497c181b1aec9801cf2ca42b41954b349fedfa /backend/libinput/events.c
parent65c436407f37118618b348b9b7303b55322d66a2 (diff)
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.
Diffstat (limited to 'backend/libinput/events.c')
-rw-r--r--backend/libinput/events.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/backend/libinput/events.c b/backend/libinput/events.c
index b9f2f43c..c5d9c67a 100644
--- a/backend/libinput/events.c
+++ b/backend/libinput/events.c
@@ -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;