From: Jihoon Kim Date: Tue, 3 Jun 2025 00:33:14 +0000 (+0900) Subject: e_comp_wl: refactor code to send touch axis X-Git-Tag: accepted/tizen/unified/20250610.081850~16 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5df67a0f79437da931d05d5a4493f9fd9ac44525;p=platform%2Fupstream%2Fenlightenment.git e_comp_wl: refactor code to send touch axis Change-Id: I8a48f84cddc1cf5a630a9759c3b9abb56f302eb1 Signed-off-by: Jihoon Kim --- diff --git a/src/bin/server/e_comp_wl.c b/src/bin/server/e_comp_wl.c index 6a6d152071..5a3366ef63 100644 --- a/src/bin/server/e_comp_wl.c +++ b/src/bin/server/e_comp_wl.c @@ -4912,8 +4912,8 @@ e_comp_wl_touch_frame_send_ec_set(E_Comp_Wl_Data *comp_wl, E_Client *ec) comp_wl->touch.frame_ec = ec; } -EINTERN Eina_Bool -e_comp_wl_touch_send(E_Client *ec, int idx, int x, int y, Eina_Bool pressed, Ecore_Device *dev, double radius_x, double radius_y, double pressure, double angle, uint32_t time) +static Eina_Bool +_e_comp_wl_device_send_event_axis(E_Client *ec, int idx, Ecore_Device *dev, double radius_x, double radius_y, double pressure, double angle, uint32_t time) { struct wl_client *wc; uint32_t serial; @@ -4945,6 +4945,19 @@ e_comp_wl_touch_send(E_Client *ec, int idx, int x, int y, Eina_Bool pressed, Eco _e_comp_wl_device_handle_axes(device->identifier, device->clas, ec, idx, radius_x, radius_y, pressure, angle); } + return EINA_TRUE; +} + +EINTERN Eina_Bool +e_comp_wl_touch_send(E_Client *ec, int idx, int x, int y, Eina_Bool pressed, Ecore_Device *dev, double radius_x, double radius_y, double pressure, double angle, uint32_t time) +{ + E_Comp_Wl_Data *comp_wl; + comp_wl = e_comp_wl_get(); + EINA_SAFETY_ON_NULL_RETURN_VAL(comp_wl, EINA_FALSE); + + if (!_e_comp_wl_device_send_event_axis(ec, idx, dev, radius_x, radius_y, pressure, angle, time)) + return EINA_FALSE; + x = x + ec->client.x; y = y + ec->client.y; @@ -4956,35 +4969,12 @@ e_comp_wl_touch_send(E_Client *ec, int idx, int x, int y, Eina_Bool pressed, Eco EINTERN Eina_Bool e_comp_wl_touch_update_send(E_Client *ec, int idx, int x, int y, Ecore_Device *dev, double radius_x, double radius_y, double pressure, double angle, uint32_t time) { - E_Devicemgr_Input_Device *device; - uint32_t serial; - struct wl_client *wc; E_Comp_Wl_Data *comp_wl; - - EINA_SAFETY_ON_NULL_RETURN_VAL(ec, EINA_FALSE); - comp_wl = e_comp_wl_get(); EINA_SAFETY_ON_NULL_RETURN_VAL(comp_wl, EINA_FALSE); - struct wl_resource *surface = e_comp_wl_client_surface_get(ec); - EINA_SAFETY_ON_NULL_RETURN_VAL(surface, EINA_FALSE); - - if (!dev) device = e_comp_wl_device_last_device_get(ECORE_DEVICE_CLASS_TOUCH); - - wc = wl_resource_get_client(surface); - if (!time) time = e_util_timestamp_get(); - serial = wl_display_next_serial(comp_wl->wl.disp); - - if (dev) - { - _e_comp_wl_send_event_device(wc, time, dev, serial); - _e_comp_wl_device_handle_axes(ecore_device_identifier_get(dev), ECORE_DEVICE_CLASS_TOUCH, ec, idx, radius_x, radius_y, pressure, angle); - } - else if (device) - { - _e_comp_wl_device_send_last_event_device(comp_wl, ec, ECORE_DEVICE_CLASS_TOUCH, time); - _e_comp_wl_device_handle_axes(device->identifier, device->clas, ec, idx, radius_x, radius_y, pressure, angle); - } + if (!_e_comp_wl_device_send_event_axis(ec, idx, dev, radius_x, radius_y, pressure, angle, time)) + return EINA_FALSE; x = x + ec->client.x; y = y + ec->client.y;