e_client: fix code for resizing floating mode window 90/278490/1 accepted/tizen/unified/20220722.031017 submit/tizen/20220721.101438
authorDoyoun Kang <doyoun.kang@samsung.com>
Thu, 21 Jul 2022 05:41:07 +0000 (14:41 +0900)
committerJunseok Kim <juns.kim@samsung.com>
Thu, 21 Jul 2022 06:08:46 +0000 (15:08 +0900)
There was a bug that the floating mode window resized invalid when the target was rotated.
This patch resolve this problem.

Change-Id: I39b4a1f4c94e8a782a7117c7c26075aa1a25d1ec

src/bin/e_client.c

index 42b2b69abf2a855c046eb61deed38746a1de9bc4..a83f2eda80f097e3daf1c5755cf8da411380f35a 100644 (file)
@@ -6754,38 +6754,26 @@ e_client_act_resize_begin(E_Client *ec, E_Binding_Event_Mouse_Button *ev, E_Poin
         snprintf(source, sizeof(source) - 1, "mouse,down,%i", ev->button);
         _e_client_moveinfo_gather(ec, source);
 
-        if ((ec->floating) &&
-            (resize_mode != E_POINTER_RESIZE_NONE))
+        /* Use canvas.x, canvas.y of event.
+         * Transformed coordinates has to be considered for accurate resize_mode
+         * rather than absolute coordinates. */
+        if ((ev->canvas.x > (ec->x + ec->w / 5)) &&
+            (ev->canvas.x < (ec->x + ec->w * 4 / 5)))
           {
-             /* set resizing direction only for floating mode window */
-             ec->resize_mode = resize_mode;
+             if (ev->canvas.y < (ec->y + ec->h / 2)) ec->resize_mode = E_POINTER_RESIZE_T;
+             else ec->resize_mode = E_POINTER_RESIZE_B;
+          }
+        else if (ev->canvas.x < (ec->x + ec->w / 2))
+          {
+             if ((ev->canvas.y > (ec->y + ec->h / 5)) && (ev->canvas.y < (ec->y + ec->h * 4 / 5))) ec->resize_mode = E_POINTER_RESIZE_L;
+             else if (ev->canvas.y < (ec->y + ec->h / 2)) ec->resize_mode = E_POINTER_RESIZE_TL;
+             else ec->resize_mode = E_POINTER_RESIZE_BL;
           }
         else
           {
-             /* setting resize mothod of open-source style according to mouse position,
-              * but we don't know how it exactly does. */
-
-             /* Use canvas.x, canvas.y of event.
-              * Transformed coordinates has to be considered for accurate resize_mode
-              * rather than absolute coordinates. */
-             if ((ev->canvas.x > (ec->x + ec->w / 5)) &&
-                 (ev->canvas.x < (ec->x + ec->w * 4 / 5)))
-               {
-                  if (ev->canvas.y < (ec->y + ec->h / 2)) ec->resize_mode = E_POINTER_RESIZE_T;
-                  else ec->resize_mode = E_POINTER_RESIZE_B;
-               }
-             else if (ev->canvas.x < (ec->x + ec->w / 2))
-               {
-                  if ((ev->canvas.y > (ec->y + ec->h / 5)) && (ev->canvas.y < (ec->y + ec->h * 4 / 5))) ec->resize_mode = E_POINTER_RESIZE_L;
-                  else if (ev->canvas.y < (ec->y + ec->h / 2)) ec->resize_mode = E_POINTER_RESIZE_TL;
-                  else ec->resize_mode = E_POINTER_RESIZE_BL;
-               }
-             else
-               {
-                  if ((ev->canvas.y > (ec->y + ec->h / 5)) && (ev->canvas.y < (ec->y + ec->h * 4 / 5))) ec->resize_mode = E_POINTER_RESIZE_R;
-                  else if (ev->canvas.y < (ec->y + ec->h / 2)) ec->resize_mode = E_POINTER_RESIZE_TR;
-                  else ec->resize_mode = E_POINTER_RESIZE_BR;
-               }
+             if ((ev->canvas.y > (ec->y + ec->h / 5)) && (ev->canvas.y < (ec->y + ec->h * 4 / 5))) ec->resize_mode = E_POINTER_RESIZE_R;
+             else if (ev->canvas.y < (ec->y + ec->h / 2)) ec->resize_mode = E_POINTER_RESIZE_TR;
+             else ec->resize_mode = E_POINTER_RESIZE_BR;
           }
      }
    if (!e_client_resize_begin(ec))