e_client: use surface-local coordinate to check input rect of the client
authorJunseok Kim <juns.kim@samsung.com>
Thu, 17 Aug 2023 06:08:43 +0000 (15:08 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Fri, 18 Aug 2023 05:32:03 +0000 (14:32 +0900)
There was a bug that input rect didn't fit with partial sized surface.
It's caused by the position checker consider as local coordinate of the client to absolute coordinate.
To correct this bug, consider the position of the client to use surface-local coordinate.

Change-Id: I0f98c5ada983af2dac919467b5e899aaca401e4b

src/bin/e_client.c

index 6123b9d..106223f 100644 (file)
@@ -1875,13 +1875,14 @@ _e_client_position_inside_input_rect(E_Client *ec, int tx, int ty)
 
    EINA_SAFETY_ON_NULL_RETURN_VAL(ec, EINA_FALSE);
 
+   e_client_geometry_get(ec, &x, &y, &w, &h);
    e_comp_object_input_rect_get(ec->frame, &list);
    if (list)
      {
         EINA_LIST_FOREACH(list, l, data)
           {
-             if ((tx >= data->x) && (tx <= data->x + data->w) &&
-                 (ty >= data->y) && (ty <= data->y + data->h))
+             if ((tx >= x + data->x) && (tx <= x + data->x + data->w) &&
+                 (ty >= y + data->y) && (ty <= y + data->y + data->h))
                {
                   res = EINA_TRUE;
                   break;
@@ -1891,8 +1892,6 @@ _e_client_position_inside_input_rect(E_Client *ec, int tx, int ty)
      }
    else
      {
-        e_client_geometry_get(ec, &x, &y, &w, &h);
-
         if ((tx >= x) && (tx <= x + w) &&
             (ty >= y) && (ty <= y + h))
           {