e_comp_wl: add intercept hooks for touch down/up 82/314482/1
authorduna.oh <duna.oh@samsung.com>
Thu, 11 Jul 2024 12:33:15 +0000 (21:33 +0900)
committerTizen Window System <tizen.windowsystem@gmail.com>
Fri, 12 Jul 2024 06:59:35 +0000 (15:59 +0900)
Change-Id: I6da339ba4681d11c6a94267fbe27911bccb29258

src/bin/server/e_comp_wl.c
src/include/e_comp_wl.h

index 16d275c89555e3ce50047825c8c1249eead43bdb..32b30d834f3a685bc7742f6b401ab06091187908 100644 (file)
@@ -140,6 +140,8 @@ static Eina_Inlist *_e_comp_wl_intercept_hooks[] =
    [E_COMP_WL_INTERCEPT_HOOK_CURSOR_TIMER_MOUSE_WHEEL] = NULL,
    [E_COMP_WL_INTERCEPT_HOOK_CURSOR_TIMER_MOUSE_DOWN] = NULL,
    [E_COMP_WL_INTERCEPT_HOOK_CURSOR_TIMER_MOUSE_UP] = NULL,
+   [E_COMP_WL_INTERCEPT_HOOK_TOUCH_DOWN] = NULL,
+   [E_COMP_WL_INTERCEPT_HOOK_TOUCH_UP] = NULL,
 };
 
 static Eina_List *hooks = NULL;
@@ -1425,10 +1427,24 @@ _e_comp_wl_send_touch(E_Client *ec, int idx, int canvas_x, int canvas_y, uint32_
 
    if (pressed)
      {
-        x = wl_fixed_from_int(canvas_x - ec->client.x);
-        y = wl_fixed_from_int(canvas_y - ec->client.y);
+         if (!_e_comp_wl_intercept_hook_call(E_COMP_WL_INTERCEPT_HOOK_TOUCH_DOWN, ec))
+         {
+            ELOGF("Touch", "Down. Intercepted.", ec);
+            return;
+         }
+     }
+   else
+     {
+         if (!_e_comp_wl_intercept_hook_call(E_COMP_WL_INTERCEPT_HOOK_TOUCH_UP, ec))
+         {
+            ELOGF("Touch", "Up. Intercepted.", ec);
+            return;
+         }
      }
 
+   x = wl_fixed_from_int(canvas_x - ec->client.x);
+   y = wl_fixed_from_int(canvas_y - ec->client.y);
+
    EINA_LIST_FOREACH(e_comp_wl->touch.resources, l, res)
      {
         if (wl_resource_get_client(res) != wc) continue;
index b99dfc5c3578f5ba1b155903fad25e883dd6d2e4..34b537cd91bd5bde16aa2929d751b4ed32b7f4b2 100644 (file)
@@ -108,6 +108,8 @@ typedef enum _E_Comp_Wl_Intercept_Hook_Point
    E_COMP_WL_INTERCEPT_HOOK_CURSOR_TIMER_MOUSE_WHEEL,
    E_COMP_WL_INTERCEPT_HOOK_CURSOR_TIMER_MOUSE_DOWN,
    E_COMP_WL_INTERCEPT_HOOK_CURSOR_TIMER_MOUSE_UP,
+   E_COMP_WL_INTERCEPT_HOOK_TOUCH_DOWN,
+   E_COMP_WL_INTERCEPT_HOOK_TOUCH_UP,
    E_COMP_WL_INTERCEPT_HOOK_LAST,
 } E_Comp_Wl_Intercept_Hook_Point;