Merge branch 'unaccel-gestures' into 'master'

pointer: add unaccelerated deltas to touchpad gesture events

See merge request wlroots/wlroots!3410
This commit is contained in:
Val Packett 2025-08-02 09:07:22 -03:00
commit d925decb2b
2 changed files with 6 additions and 0 deletions

View file

@ -187,6 +187,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),
};
wl_signal_emit_mutable(&pointer->events.swipe_update, &wlr_event);
}
@ -228,6 +230,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),
};

View file

@ -96,6 +96,7 @@ struct wlr_pointer_swipe_update_event {
// Relative coordinates of the logical center of the gesture
// compared to the previous event.
double dx, dy;
double unaccel_dx, unaccel_dy;
};
struct wlr_pointer_swipe_end_event {
@ -117,6 +118,7 @@ struct wlr_pointer_pinch_update_event {
// 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.