From c18ca707dec2d6676cbe0f485b416901dabbcc4e Mon Sep 17 00:00:00 2001 From: Junseok Kim Date: Wed, 4 Oct 2023 16:20:28 +0900 Subject: [PATCH] e_comp_wl: send transformed position if the client use transform Change-Id: Ifaf1d887a4aeaa9c450c5bf98541d5363a2f8367 --- src/bin/e_client.c | 4 +++- src/bin/e_comp_wl.c | 18 ++++++++++++++---- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/src/bin/e_client.c b/src/bin/e_client.c index 2c22684..4beea23 100644 --- a/src/bin/e_client.c +++ b/src/bin/e_client.c @@ -1981,6 +1981,7 @@ static E_Client * _e_client_input_rect_under_pointer_helper(E_Desk *desk, E_Client *exclude, int x, int y) { E_Client *ec = NULL, *cec; + int cx, cy, cw, ch; E_CLIENT_REVERSE_FOREACH(cec) { @@ -1990,7 +1991,8 @@ _e_client_input_rect_under_pointer_helper(E_Desk *desk, E_Client *exclude, int x if (!evas_object_visible_get(cec->frame)) continue; if (e_policy_client_is_cursor(cec)) continue; if ((exclude) && (cec == exclude)) continue; - if (!E_INSIDE(x, y, cec->x, cec->y, cec->w, cec->h)) + e_client_geometry_get(cec, &cx, &cy, &cw, &ch); + if (!E_INSIDE(x, y, cx, cy, cw, ch)) continue; /* If the layer is higher, the position of the window is higher * (always on top vs always below) */ diff --git a/src/bin/e_comp_wl.c b/src/bin/e_comp_wl.c index 2eb5f01..eb608c0 100644 --- a/src/bin/e_comp_wl.c +++ b/src/bin/e_comp_wl.c @@ -2521,10 +2521,11 @@ _e_comp_wl_cb_comp_object_add(void *data EINA_UNUSED, int type EINA_UNUSED, E_Ev static Eina_Bool _e_comp_wl_cb_mouse_move(void *d EINA_UNUSED, int t EINA_UNUSED, Ecore_Event_Mouse_Move *ev) { + int ec_x, ec_y; + e_comp_wl->ptr.x = wl_fixed_from_int(ev->x); e_comp_wl->ptr.y = wl_fixed_from_int(ev->y); - if (e_comp_wl->selection.target && e_comp_wl->drag) { @@ -2559,12 +2560,21 @@ _e_comp_wl_cb_mouse_move(void *d EINA_UNUSED, int t EINA_UNUSED, Ecore_Event_Mou e_comp_wl_data_device_send_enter(ec); } - x = ev->x - ec->client.x; - y = ev->y - ec->client.y; - if (e_comp_wl->drag) e_drag_move(e_comp_wl->drag, ev->x, ev->y); + e_client_geometry_get(ec, &ec_x, &ec_y, NULL, NULL); + x = ev->x - ec_x; + y = ev->y - ec_y; + + if (e_client_transform_core_enable_get(ec)) + { + int trans_x, trans_y; + e_client_transform_core_input_transform(ec, x, y, &trans_x, &trans_y); + x = trans_x; + y = trans_y; + } + wl_data_device_send_motion(res, ev->timestamp, wl_fixed_from_int(x), wl_fixed_from_int(y)); } -- 2.7.4