From 5b94d6f3b61b22225d1651f808343572d9ec7fa4 Mon Sep 17 00:00:00 2001 From: Greg V Date: Wed, 22 Dec 2021 19:32:43 +0300 Subject: [PATCH] pointer: add unaccelerated deltas to touchpad gesture events These are not used by Wayland, but can be used by the compositor's built-in features. --- backend/libinput/pointer.c | 4 ++++ include/wlr/types/wlr_pointer.h | 2 ++ 2 files changed, 6 insertions(+) diff --git a/backend/libinput/pointer.c b/backend/libinput/pointer.c index 520f98dcf..745275df5 100644 --- a/backend/libinput/pointer.c +++ b/backend/libinput/pointer.c @@ -177,6 +177,8 @@ void handle_pointer_swipe_update(struct libinput_event *event, .fingers = libinput_event_gesture_get_finger_count(gevent), .dx = libinput_event_gesture_get_dx(gevent), .dy = libinput_event_gesture_get_dy(gevent), + .unaccel_dx = libinput_event_gesture_get_dx_unaccelerated(gevent), + .unaccel_dy = libinput_event_gesture_get_dy_unaccelerated(gevent), }; wlr_signal_emit_safe(&wlr_dev->pointer->events.swipe_update, &wlr_event); } @@ -236,6 +238,8 @@ void handle_pointer_pinch_update(struct libinput_event *event, .fingers = libinput_event_gesture_get_finger_count(gevent), .dx = libinput_event_gesture_get_dx(gevent), .dy = libinput_event_gesture_get_dy(gevent), + .unaccel_dx = libinput_event_gesture_get_dx_unaccelerated(gevent), + .unaccel_dy = libinput_event_gesture_get_dy_unaccelerated(gevent), .scale = libinput_event_gesture_get_scale(gevent), .rotation = libinput_event_gesture_get_angle_delta(gevent), }; diff --git a/include/wlr/types/wlr_pointer.h b/include/wlr/types/wlr_pointer.h index bcfb2ad3d..f36da99cd 100644 --- a/include/wlr/types/wlr_pointer.h +++ b/include/wlr/types/wlr_pointer.h @@ -96,6 +96,7 @@ struct wlr_event_pointer_swipe_update { // Relative coordinates of the logical center of the gesture // compared to the previous event. double dx, dy; + double unaccel_dx, unaccel_dy; }; struct wlr_event_pointer_swipe_end { @@ -117,6 +118,7 @@ struct wlr_event_pointer_pinch_update { // Relative coordinates of the logical center of the gesture // compared to the previous event. double dx, dy; + double unaccel_dx, unaccel_dy; // Absolute scale compared to the begin event double scale; // Relative angle in degrees clockwise compared to the previous event.