e_comp_wl: add intercept hooks for cursor timer when mouse wheel/down/up 57/292857/1
authorduna.oh <duna.oh@samsung.com>
Wed, 10 May 2023 05:11:02 +0000 (14:11 +0900)
committerTizen Window System <tizen.windowsystem@gmail.com>
Tue, 16 May 2023 04:39:39 +0000 (13:39 +0900)
Change-Id: I00467aa607b43a5f8e463e5e44394b26d7e8eb79

src/bin/e_comp_wl.c
src/bin/e_comp_wl.h

index 9b701d7..1304fb3 100644 (file)
@@ -26,6 +26,7 @@
 static void _e_comp_wl_move_resize_init(void);
 
 static E_Client * _e_comp_wl_client_usable_get(pid_t pid, E_Pixmap *ep);
+static Eina_Bool _e_comp_wl_cursor_timer_control(Evas_Callback_Type type, E_Client *ec);
 
 /* local variables */
 typedef struct _E_Comp_Wl_Key_Data
@@ -81,6 +82,9 @@ static Eina_Inlist *_e_comp_wl_intercept_hooks[] =
    [E_COMP_WL_INTERCEPT_HOOK_CURSOR_TIMER_MOUSE_IN] = NULL,
    [E_COMP_WL_INTERCEPT_HOOK_CURSOR_TIMER_MOUSE_OUT] = NULL,
    [E_COMP_WL_INTERCEPT_HOOK_CURSOR_TIMER_MOUSE_MOVE] = NULL,
+   [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,
 };
 
 static Eina_List *hooks = NULL;
@@ -1061,6 +1065,33 @@ _e_comp_wl_cursor_timer_control(Evas_Callback_Type type, E_Client *ec)
             _e_comp_wl_cursor_reload(ec);
           break;
 
+        case EVAS_CALLBACK_MOUSE_WHEEL:
+          ret = _e_comp_wl_intercept_hook_call(E_COMP_WL_INTERCEPT_HOOK_CURSOR_TIMER_MOUSE_WHEEL, ec);
+          if (!ret) break;
+
+          if (e_pointer_is_hidden(e_comp->pointer))
+            _e_comp_wl_cursor_reload(ec);
+          break;
+
+        case EVAS_CALLBACK_MOUSE_DOWN:
+          ret = _e_comp_wl_intercept_hook_call(E_COMP_WL_INTERCEPT_HOOK_CURSOR_TIMER_MOUSE_DOWN, ec);
+          if (!ret) break;
+
+          if (e_comp_wl->ptr.hide_tmr)
+            {
+               ecore_timer_del(e_comp_wl->ptr.hide_tmr);
+               e_comp_wl->ptr.hide_tmr = NULL;
+            }
+          cursor_timer_ec = NULL;
+
+          if (e_pointer_is_hidden(e_comp->pointer))
+            _e_comp_wl_cursor_reload(ec);
+          break;
+
+        case EVAS_CALLBACK_MOUSE_UP:
+          ret = _e_comp_wl_intercept_hook_call(E_COMP_WL_INTERCEPT_HOOK_CURSOR_TIMER_MOUSE_UP, ec);
+          if (!ret) break;
+
         default:
           break;
      }
@@ -1406,15 +1437,8 @@ _e_comp_wl_evas_cb_mouse_down(void *data, Evas *evas EINA_UNUSED, Evas_Object *o
      {
         if (e_config->use_cursor_timer)
           {
-             if (e_comp_wl->ptr.hide_tmr)
-               {
-                  ecore_timer_del(e_comp_wl->ptr.hide_tmr);
-                  e_comp_wl->ptr.hide_tmr = NULL;
-               }
-             cursor_timer_ec = NULL;
-
-             if (e_pointer_is_hidden(e_comp->pointer))
-               _e_comp_wl_cursor_reload(ec);
+             if (!_e_comp_wl_cursor_timer_control(EVAS_CALLBACK_MOUSE_DOWN, ec))
+               return;
           }
 
         e_comp_wl_evas_handle_mouse_button(ec, ev->timestamp, ev->button,
@@ -1486,6 +1510,12 @@ _e_comp_wl_evas_cb_mouse_up(void *data, Evas *evas, Evas_Object *obj, void *even
      }
    else
      {
+        if (e_config->use_cursor_timer)
+          {
+             if (!_e_comp_wl_cursor_timer_control(EVAS_CALLBACK_MOUSE_UP, ec))
+               return;
+          }
+
         e_comp_wl_evas_handle_mouse_button(ec, ev->timestamp, ev->button,
                                            WL_POINTER_BUTTON_STATE_RELEASED);
 
@@ -1547,8 +1577,8 @@ _e_comp_wl_evas_cb_mouse_wheel(void *data, Evas *evas EINA_UNUSED, Evas_Object *
 
    if (e_config->use_cursor_timer)
       {
-         if (e_pointer_is_hidden(e_comp->pointer))
-           _e_comp_wl_cursor_reload(ec);
+         if (!_e_comp_wl_cursor_timer_control(EVAS_CALLBACK_MOUSE_WHEEL, ec))
+           return;
       }
 
    _e_comp_wl_device_send_event_device(ec, ev->dev, ev->timestamp);
@@ -5590,8 +5620,8 @@ e_comp_wl_mouse_wheel_send(E_Client *ec, int direction, int z, Ecore_Device *dev
 
    if (e_config->use_cursor_timer)
       {
-         if (e_pointer_is_hidden(e_comp->pointer))
-           _e_comp_wl_cursor_reload(ec);
+         if (!_e_comp_wl_cursor_timer_control(EVAS_CALLBACK_MOUSE_WHEEL, ec))
+           return EINA_TRUE;
       }
 
    if (dev) _e_comp_wl_send_event_device(wc, time, dev, serial);
index 2221120..281bf81 100644 (file)
@@ -88,6 +88,9 @@ typedef enum _E_Comp_Wl_Intercept_Hook_Point
    E_COMP_WL_INTERCEPT_HOOK_CURSOR_TIMER_MOUSE_IN,
    E_COMP_WL_INTERCEPT_HOOK_CURSOR_TIMER_MOUSE_OUT,
    E_COMP_WL_INTERCEPT_HOOK_CURSOR_TIMER_MOUSE_MOVE,
+   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_LAST,
 } E_Comp_Wl_Intercept_Hook_Point;