rotation: code refactoring 50/279050/1 accepted/tizen_7.0_unified_hotfix tizen_7.0_hotfix accepted/tizen/7.0/unified/20221110.055913 accepted/tizen/7.0/unified/hotfix/20221116.110028 accepted/tizen/unified/20220801.131408 submit/tizen/20220801.072725 tizen_7.0_m2_release
authorDoyoun Kang <doyoun.kang@samsung.com>
Mon, 1 Aug 2022 07:06:52 +0000 (16:06 +0900)
committerDoyoun Kang <doyoun.kang@samsung.com>
Mon, 1 Aug 2022 07:06:56 +0000 (16:06 +0900)
Just move the location of _e_tizen_rotation_smart_placement_apply function.
There is no logic change.

Change-Id: I2be6f1edf713d90c15c716a0dec6361ef7fa2928

src/rotation/e_mod_rotation_wl.c

index 4b73eee..cd319bf 100644 (file)
@@ -622,98 +622,6 @@ _e_tizen_rotation_angle_change(Policy_Ext_Rotation *rot)
 }
 
 static void
-_e_tizen_rotation_smart_placement_apply(E_Client *ec)
-{
-   int angle = 0;
-   int x, y, w, h;
-   int new_x, new_y;
-   int x1, y1, x2, y2;
-   int zx, zy, zw, zh;
-
-   angle = ec->zone->rot.curr;
-
-   e_client_geometry_get(ec, &x, &y, &w, &h);
-   new_x = x;
-   new_y = y;
-
-   x1 = x;
-   x2 = x+w;
-   y1 = y;
-   y2 = y+h;
-
-   zx = ec->zone->x;
-   zy = ec->zone->y;
-   zw = ec->zone->w;
-   zh = ec->zone->h;
-
-   // calculate x position
-   if (x1 < 0)
-     {
-        if (w > zw)
-          {
-             if (angle == 270)
-               new_x = -w;
-             else
-               new_x = 0;
-          }
-        else
-          new_x = 0;
-     }
-   else if (x2 > zx + zw)
-     {
-        if (w > zw)
-          {
-             if (angle == 270\r)
-               new_x = -w;
-             else
-               new_x = 0;
-          }
-        else
-          new_x = zx + zw - w;
-     }
-   else
-     {
-        new_x = x;
-     }
-
-   // calculate y position
-   if (y1 < 0)
-     {
-        if (h > zh)
-          {
-             if (angle == 180)
-               new_y = -h;
-             else
-               new_y = 0;
-          }
-        else
-          new_y = 0;
-     }
-   else if (y2 > zy + zh)
-     {
-        if (h > zh)
-          {
-             if (angle == 180)
-               new_y = -h;
-             else
-               new_y = 0;
-          }
-        else
-          new_y = zy + zh - h;
-     }
-   else
-     {
-        new_y = y;
-     }
-
-   if ((x != new_x) || (y != new_y))
-     {
-        ELOGF("ROTATION", "APPLY placement policy. old(%d,%d) -> new(%d,%d), angle:%d", ec, x, y, new_x, new_y, angle);
-        e_client_util_move_without_frame(ec, new_x, new_y);
-     }
-}
-
-static void
 _e_tizen_rotation_ack_angle_change_cb(struct wl_client *client,
                                       struct wl_resource *resource,
                                       uint32_t serial)
@@ -2481,6 +2389,98 @@ _rot_cb_zone_rotation_change_begin(void *data EINA_UNUSED, int ev_type EINA_UNUS
 }
 
 static void
+_e_tizen_rotation_smart_placement_apply(E_Client *ec)
+{
+   int angle = 0;
+   int x, y, w, h;
+   int new_x, new_y;
+   int x1, y1, x2, y2;
+   int zx, zy, zw, zh;
+
+   angle = ec->zone->rot.curr;
+
+   e_client_geometry_get(ec, &x, &y, &w, &h);
+   new_x = x;
+   new_y = y;
+
+   x1 = x;
+   x2 = x+w;
+   y1 = y;
+   y2 = y+h;
+
+   zx = ec->zone->x;
+   zy = ec->zone->y;
+   zw = ec->zone->w;
+   zh = ec->zone->h;
+
+   // calculate x position
+   if (x1 < 0)
+     {
+        if (w > zw)
+          {
+             if (angle == 270)
+               new_x = -w;
+             else
+               new_x = 0;
+          }
+        else
+          new_x = 0;
+     }
+   else if (x2 > zx + zw)
+     {
+        if (w > zw)
+          {
+             if (angle == 270)
+               new_x = -w;
+             else
+               new_x = 0;
+          }
+        else
+          new_x = zx + zw - w;
+     }
+   else
+     {
+        new_x = x;
+     }
+
+   // calculate y position
+   if (y1 < 0)
+     {
+        if (h > zh)
+          {
+             if (angle == 180)
+               new_y = -h;
+             else
+               new_y = 0;
+          }
+        else
+          new_y = 0;
+     }
+   else if (y2 > zy + zh)
+     {
+        if (h > zh)
+          {
+             if (angle == 180)
+               new_y = -h;
+             else
+               new_y = 0;
+          }
+        else
+          new_y = zy + zh - h;
+     }
+   else
+     {
+        new_y = y;
+     }
+
+   if ((x != new_x) || (y != new_y))
+     {
+        ELOGF("ROTATION", "APPLY placement policy. old(%d,%d) -> new(%d,%d), angle:%d", ec, x, y, new_x, new_y, angle);
+        e_client_util_move_without_frame(ec, new_x, new_y);
+     }
+}
+
+static void
 _e_client_rotation_wait_update_clear(E_Client *ec)
 {
    Policy_Ext_Rotation *rot;