From 6561099fd0a1555356fbda6679b405320ae5453e Mon Sep 17 00:00:00 2001 From: Ben Jargowsky Date: Mon, 8 Aug 2022 20:11:02 -0700 Subject: [PATCH] Implement wlr_relative_pointer_manager_v1 --- dwl.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/dwl.c b/dwl.c index 039b8ff..ee5104e 100644 --- a/dwl.c +++ b/dwl.c @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #include @@ -319,6 +320,7 @@ static struct wlr_input_inhibit_manager *input_inhibit_mgr; static struct wlr_layer_shell_v1 *layer_shell; static struct wlr_output_manager_v1 *output_mgr; static struct wlr_virtual_keyboard_manager_v1 *virtual_keyboard_mgr; +static struct wlr_relative_pointer_manager_v1 *rel_ptr_mgr; static struct wlr_cursor *cursor; static struct wlr_xcursor_manager *cursor_mgr; @@ -1526,6 +1528,10 @@ motionrelative(struct wl_listener *listener, void *data) /* This event is forwarded by the cursor when a pointer emits a _relative_ * pointer motion event (i.e. a delta) */ struct wlr_event_pointer_motion *event = data; + + wlr_relative_pointer_manager_v1_send_relative_motion(rel_ptr_mgr, seat, event->time_msec * 1000, + event->delta_x, event->delta_y, event->unaccel_dx, event->unaccel_dy); + /* The cursor doesn't move unless we tell it to. The cursor automatically * handles constraining the motion to the output layout, as well as any * special configuration applied for the specific input device which @@ -2086,6 +2092,8 @@ setup(void) * HiDPI support). Scaled cursors will be loaded with each output. */ cursor_mgr = wlr_xcursor_manager_create(NULL, 24); + rel_ptr_mgr = wlr_relative_pointer_manager_v1_create(dpy); + /* * wlr_cursor *only* displays an image on screen. It does not move around * when the pointer moves. However, we can attach input devices to it, and