From d0203446751f2b8b4e80ecf54b6ff831096c3302 Mon Sep 17 00:00:00 2001 From: random human Date: Mon, 1 Oct 2018 06:21:32 +0530 Subject: relative_pointer: implement protocol events Implement zwp_relative_pointer_v1.relative_motion event, along with some glue code in wlr_seat_pointer and rootston. --- include/wlr/types/wlr_relative_pointer_v1.h | 4 ++++ include/wlr/types/wlr_seat.h | 12 ++++++++++++ 2 files changed, 16 insertions(+) (limited to 'include') diff --git a/include/wlr/types/wlr_relative_pointer_v1.h b/include/wlr/types/wlr_relative_pointer_v1.h index 94ae053b..c74766b9 100644 --- a/include/wlr/types/wlr_relative_pointer_v1.h +++ b/include/wlr/types/wlr_relative_pointer_v1.h @@ -66,4 +66,8 @@ struct wlr_relative_pointer_v1 { struct wlr_relative_pointer_manager_v1 *wlr_relative_pointer_v1_create(struct wl_display *display); void wlr_relative_pointer_v1_destroy(struct wlr_relative_pointer_manager_v1 *relative_pointer_manager); +void wlr_relative_pointer_v1_send_relative_motion(struct wl_resource *resource, + uint64_t time, double dx, double dy, double dx_unaccel, double + dy_unaccel); + #endif diff --git a/include/wlr/types/wlr_seat.h b/include/wlr/types/wlr_seat.h index 9fc1ba95..54e04e24 100644 --- a/include/wlr/types/wlr_seat.h +++ b/include/wlr/types/wlr_seat.h @@ -314,6 +314,18 @@ void wlr_seat_pointer_clear_focus(struct wlr_seat *wlr_seat); void wlr_seat_pointer_send_motion(struct wlr_seat *wlr_seat, uint32_t time, double sx, double sy); +/** Send relative motion events to the surface with pointer focus. Coordinates + * for the motion event are relative to current pointer location, both + * accelerated and unaccelerated. Compositors should use + * `wlr_seat_pointer_notify_relative_motion()` to send relative motion events + * to respect relative pointer requests by clients. + * + * Note that the timestamp is 64 bit, split into high 32 bits and low 32 bits. + */ +void wlr_seat_pointer_notify_relative_motion(struct wlr_seat *wlr_seat, + uint64_t time, double dx, double dy, double dx_unaccel, + double dy_unaccel); + /** * Send a button event to the surface with pointer focus. Coordinates for the * button event are surface-local. Returns the serial. Compositors should use -- cgit v1.2.3