relative_pointer: implement protocol events

Implement zwp_relative_pointer_v1.relative_motion event, along with some
glue code in wlr_seat_pointer and rootston.
This commit is contained in:
random human 2018-10-01 06:21:32 +05:30 committed by Alex Maese
parent ba5b1676df
commit d020344675
5 changed files with 52 additions and 0 deletions

View file

@ -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

View file

@ -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