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. --- rootston/cursor.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'rootston') diff --git a/rootston/cursor.c b/rootston/cursor.c index b9ded30e..b03b934e 100644 --- a/rootston/cursor.c +++ b/rootston/cursor.c @@ -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; -- cgit v1.2.3