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

@ -310,6 +310,9 @@ void roots_cursor_handle_motion(struct roots_cursor *cursor,
double dx = event->delta_x;
double dy = event->delta_y;
wlr_seat_pointer_notify_relative_motion(cursor->seat->seat, (uint64_t)
event->time_msec, dx, dy, dx, dy);
if (cursor->active_constraint) {
struct roots_view *view = cursor->pointer_view->view;
assert(view);
@ -349,6 +352,11 @@ void roots_cursor_handle_motion_absolute(struct roots_cursor *cursor,
wlr_cursor_absolute_to_layout_coords(cursor->cursor, event->device, event->x,
event->y, &lx, &ly);
double dx = lx - cursor->cursor->x;
double dy = ly - cursor->cursor->y;
wlr_seat_pointer_notify_relative_motion(cursor->seat->seat, (uint64_t)
event->time_msec, dx, dy, dx, dy);
if (cursor->pointer_view) {
struct roots_view *view = cursor->pointer_view->view;