diff options
author | Doyoun Kang <doyoun.kang@samsung.com> | 2022-08-01 16:06:52 +0900 |
---|---|---|
committer | Doyoun Kang <doyoun.kang@samsung.com> | 2022-08-01 16:06:56 +0900 |
commit | c47d60eccf8374caf555bc4ba792ec4f81212377 (patch) | |
tree | 4712d4f257f9c5a67690c4dab9e356208b5a65bb | |
parent | 760fd8d0ddeb99be8e201e4aeb1c8f8418cb41a1 (diff) | |
download | e-mod-tizen-wm-policy-tizen_7.0_hotfix.tar.gz e-mod-tizen-wm-policy-tizen_7.0_hotfix.tar.bz2 e-mod-tizen-wm-policy-tizen_7.0_hotfix.zip |
rotation: code refactoringtizen_7.0_m2_releasesubmit/tizen/20220801.072725accepted/tizen/unified/20220801.131408accepted/tizen/7.0/unified/hotfix/20221116.110028accepted/tizen/7.0/unified/20221110.055913tizen_7.0_hotfixaccepted/tizen_7.0_unified_hotfix
Just move the location of _e_tizen_rotation_smart_placement_apply function.
There is no logic change.
Change-Id: I2be6f1edf713d90c15c716a0dec6361ef7fa2928
-rw-r--r-- | src/rotation/e_mod_rotation_wl.c | 184 |
1 files changed, 92 insertions, 92 deletions
diff --git a/src/rotation/e_mod_rotation_wl.c b/src/rotation/e_mod_rotation_wl.c index 4b73eee..cd319bf 100644 --- a/src/rotation/e_mod_rotation_wl.c +++ b/src/rotation/e_mod_rotation_wl.c @@ -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
) - 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; |