From 3c6f3751bdea7ccfe27ccf3556cfae5a9550c036 Mon Sep 17 00:00:00 2001 From: Sungjin Park Date: Tue, 25 Apr 2023 13:41:13 +0900 Subject: [PATCH] e_comp_wl_input: fixed to send relative motion event by setting relative_motion handler Signed-off-by: Sungjin Park --- src/bin/e_comp_wl_input.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/bin/e_comp_wl_input.c b/src/bin/e_comp_wl_input.c index 9f42239631..851cc36c96 100644 --- a/src/bin/e_comp_wl_input.c +++ b/src/bin/e_comp_wl_input.c @@ -550,6 +550,19 @@ _e_comp_wl_input_cb_bind_relative_pointer_manager(struct wl_client *client, void NULL, _e_comp_wl_cb_unbind_relative_pointer_manager); } +void +_e_comp_wl_relative_motion_cb(double dx[2], double dy[2], uint64_t time_us) +{ + Eina_Bool res; + res = e_comp_wl_mouse_relative_motion_send(e_comp_wl->ptr_constraints.ec, + (int)dx[0], (int)dy[0], (int)dx[1], (int)dy[1], NULL, time_us); + + if (!res) + { + ERR("Could not send relative_motion to ec(%p)", e_comp_wl->ptr_constraints.ec); + } +} + static void _e_comp_wl_convert_eina_tiler_to_pixman_region32(const Eina_Tiler *tiler, pixman_region32_t *region) @@ -587,6 +600,7 @@ _e_comp_wl_pointer_constraint_deactivate(E_Comp_Wl_Pointer_Constraint *constrain constraint->active = EINA_FALSE; e_comp_wl->ptr_constraints.activated = EINA_FALSE; e_comp_wl->ptr_constraints.ec = NULL; + e_input_relative_motion_handler_set(NULL); _e_comp_wl_pointer_constraint_notify_deactivated(constraint); wl_list_remove(&constraint->surface_unmap_listener.link); wl_list_init(&constraint->surface_unmap_listener.link); @@ -670,6 +684,10 @@ _e_comp_wl_pointer_constraint_enable(E_Comp_Wl_Pointer_Constraint *constraint) e_comp_wl->ptr_constraints.activated = EINA_TRUE; e_comp_wl->ptr_constraints.ec = ec; _e_comp_wl_pointer_constraint_notify_activated(constraint); + if (!e_input_relative_motion_handler_set(_e_comp_wl_relative_motion_cb)) + { + ERR("ERROR! Could not set relative motion handler !"); + } wl_signal_add(&e_comp_wl->ptr_constraints.surface_unmap_signal, &constraint->surface_unmap_listener); } -- 2.34.1