e_comp_object: fix the bug not moving the cursor 33/319033/1
authorSooChan Lim <sc1.lim@samsung.com>
Mon, 3 Feb 2025 10:29:02 +0000 (19:29 +0900)
committerTizen Window System <tizen.windowsystem@gmail.com>
Mon, 3 Feb 2025 10:45:18 +0000 (19:45 +0900)
This patch fixes the cursor moving bug.

Change-Id: I8e118a499773c47342206a41c2be2dd6c4bb0e29

src/bin/compmgr/e_comp_object.c

index 2168ec2bb784d04cc50c619b06b4701e670a5708..ca604bd919594f1f9ad4955bad64dd47191faa0c 100644 (file)
@@ -1164,6 +1164,7 @@ static void
 _e_comp_intercept_move(void *data, Evas_Object *obj, int x, int y)
 {
    E_Comp_Object *cw = data;
+   int ix, iy;
 
    if (cw->render_update_lock.lock)
      {
@@ -1229,6 +1230,8 @@ _e_comp_intercept_move(void *data, Evas_Object *obj, int x, int y)
         if ((cw->ec->maximized & E_MAXIMIZE_DIRECTION) == E_MAXIMIZE_HORIZONTAL)
           x = cw->x;
      }
+   ix = x;
+   iy = y;
    if (cw->ec->maximized && (!cw->ec->maximize_override) && ((cw->ec->x != x) || (cw->ec->y != y)) &&
        ((cw->ec->maximized & E_MAXIMIZE_DIRECTION) != E_MAXIMIZE_VERTICAL) &&
        ((cw->ec->maximized & E_MAXIMIZE_DIRECTION) != E_MAXIMIZE_HORIZONTAL))
@@ -1242,8 +1245,8 @@ _e_comp_intercept_move(void *data, Evas_Object *obj, int x, int y)
         if (!zone) return;
 
         cw->ec->changes.need_unmaximize = 1;
-        cw->ec->saved.x = 0 - zone->x;
-        cw->ec->saved.y = 0 - zone->y;
+        cw->ec->saved.x = ix;
+        cw->ec->saved.y = iy;
         cw->ec->saved.w = cw->ec->client.w;
         cw->ec->saved.h = cw->ec->client.h;
         EC_CHANGED(cw->ec);
@@ -1270,10 +1273,10 @@ _e_comp_intercept_move(void *data, Evas_Object *obj, int x, int y)
      {
         /* only update xy position of client to avoid invalid
          * first damage region if it is not a new_client. */
-        cw->ec->client.x = 0;
-        cw->ec->client.y = 0;
+        cw->ec->client.x = ix;
+        cw->ec->client.y = iy;
 
-        x = 0, y = 0;
+        x = ix, y = iy;
         evas_object_move(obj, x, y);
      }
 }
@@ -1282,7 +1285,7 @@ static void
 _e_comp_intercept_resize(void *data, Evas_Object *obj, int w, int h)
 {
    E_Comp_Object *cw = data;
-   int pw = 0, ph = 0, prev_w, prev_h, x, y;
+   int pw = 0, ph = 0, iw, ih, prev_w, prev_h, x, y;
    E_Zone *zone;
 
    if (cw->render_update_lock.lock)
@@ -1321,6 +1324,8 @@ _e_comp_intercept_resize(void *data, Evas_Object *obj, int w, int h)
           return;
      }
    /* calculate client size */
+   iw = w;
+   ih = h;
    if (cw->ec->maximized && (!cw->ec->maximize_override) && ((cw->ec->w != w) || (cw->ec->h != h)))
      {
         /* prevent resizing while maximized depending on direction and config */
@@ -1329,18 +1334,18 @@ _e_comp_intercept_resize(void *data, Evas_Object *obj, int w, int h)
         Eina_Bool reject = EINA_FALSE;
         if (cw->ec->maximized & E_MAXIMIZE_VERTICAL)
           {
-             if (cw->ec->client.h != 0)
+             if (cw->ec->client.h != ih)
                {
-                  cw->ec->saved.h = 0;
+                  cw->ec->saved.h = ih;
                   cw->ec->saved.y = cw->ec->client.y - zone->y;
                   reject = cw->ec->changes.need_unmaximize = 1;
                }
           }
         if (cw->ec->maximized & E_MAXIMIZE_HORIZONTAL)
           {
-             if (cw->ec->client.w != 0)
+             if (cw->ec->client.w != iw)
                {
-                  cw->ec->saved.w = 0;
+                  cw->ec->saved.w = iw;
                   cw->ec->saved.x = cw->ec->client.x - zone->x;
                   reject = cw->ec->changes.need_unmaximize = 1;
                }
@@ -1374,8 +1379,8 @@ _e_comp_intercept_resize(void *data, Evas_Object *obj, int w, int h)
 
    e_client_size_set(cw->ec, w, h);
 
-   cw->ec->client.w = 0;
-   cw->ec->client.h = 0;
+   cw->ec->client.w = iw;
+   cw->ec->client.h = ih;
    if ((cw->ec->client.w < 0) || (cw->ec->client.h < 0)) CRI("WTF. ec:%p", cw->ec);
 
    /* The size of non-compositing window can be changed, so there is a