From cc4d1963e0ce4ccd677859157b18797b908581b5 Mon Sep 17 00:00:00 2001 From: Doyoun Kang Date: Thu, 13 Apr 2023 20:22:45 +0900 Subject: [PATCH] e_client/e_policy: subdivide the shadow size of decorator We subdivided the shadow size of decorator into top, bottom, left, right. Change-Id: Iabfa65039407ef8b9cfa23370a62497f59194db2 --- src/bin/e_client.h | 6 +++- src/bin/e_policy_wl.c | 82 ++++++++++++++++++++++++++++++++++++++++----------- 2 files changed, 70 insertions(+), 18 deletions(-) diff --git a/src/bin/e_client.h b/src/bin/e_client.h index 191daf3..b107840 100644 --- a/src/bin/e_client.h +++ b/src/bin/e_client.h @@ -1046,8 +1046,12 @@ struct E_Client Eina_Bool enable_aspect_ratio; Evas_Object *resize_obj; float aw, ah; - int header_h, footer_h, shadow; + int header_h, footer_h; unsigned int unit_size; + struct + { + int t, b, l, r; + } shadow; } manage_resize; Eina_Bool move_after_resize; diff --git a/src/bin/e_policy_wl.c b/src/bin/e_policy_wl.c index 757ff1a..2260bb0 100644 --- a/src/bin/e_policy_wl.c +++ b/src/bin/e_policy_wl.c @@ -280,7 +280,10 @@ enum _E_Policy_Hint_Type E_POLICY_HINT_DECORATION_SIZE_FOOTER = 16, E_POLICY_HINT_VISIBILITY_IGNORE_GEOMETRY= 17, E_POLICY_HINT_RESIZE_PPU = 18, - E_POLICY_HINT_DECORATION_SIZE_SHADOW = 19, + E_POLICY_HINT_DECORATION_SIZE_SHADOW_TOP = 19, + E_POLICY_HINT_DECORATION_SIZE_SHADOW_BOTTOM = 20, + E_POLICY_HINT_DECORATION_SIZE_SHADOW_LEFT = 21, + E_POLICY_HINT_DECORATION_SIZE_SHADOW_RIGHT = 22, }; static const char *hint_names[] = @@ -304,7 +307,10 @@ static const char *hint_names[] = "wm.policy.win.decoration.size.footer", "wm.policy.win.visibility.ignore_geometry", "wm.policy.win.resize.ppu", - "wm.policy.win.decoration.size.shadow", + "wm.policy.win.decoration.size.shadow.top", + "wm.policy.win.decoration.size.shadow.bottom", + "wm.policy.win.decoration.size.shadow.left", + "wm.policy.win.decoration.size.shadow.right", }; static void _e_policy_wl_surf_del(E_Policy_Wl_Surface *psurf); @@ -2612,18 +2618,60 @@ _e_policy_wl_aux_hint_apply(E_Client *ec) ELOGF("RESIZE", "Set resize unit. size:%d", ec, ppu); e_client_resize_unit_size_set(ec, ppu); } - else if (!strncmp(hint->hint, hint_names[E_POLICY_HINT_DECORATION_SIZE_SHADOW], strlen(hint->hint))) + else if (!strncmp(hint->hint, hint_names[E_POLICY_HINT_DECORATION_SIZE_SHADOW_TOP], strlen(hint->hint))) { int size = atoi(hint->val); if (size > 0) { - ELOGF("CSD", "Set decoration SHADOW size.. size(%d)", ec, size); - ec->manage_resize.shadow = size; + ELOGF("CSD", "Set decoration SHADOW top.. size(%d)", ec, size); + ec->manage_resize.shadow.t = size; } else { - ELOGF("CSD", "Unset decoration SHADOW size", ec); - ec->manage_resize.shadow = 0; + ELOGF("CSD", "Unset decoration SHADOW top", ec); + ec->manage_resize.shadow.t = 0; + } + } + else if (!strncmp(hint->hint, hint_names[E_POLICY_HINT_DECORATION_SIZE_SHADOW_BOTTOM], strlen(hint->hint))) + { + int size = atoi(hint->val); + if (size > 0) + { + ELOGF("CSD", "Set decoration SHADOW bottom.. size(%d)", ec, size); + ec->manage_resize.shadow.b = size; + } + else + { + ELOGF("CSD", "Unset decoration SHADOW bottom", ec); + ec->manage_resize.shadow.b = 0; + } + } + else if (!strncmp(hint->hint, hint_names[E_POLICY_HINT_DECORATION_SIZE_SHADOW_LEFT], strlen(hint->hint))) + { + int size = atoi(hint->val); + if (size > 0) + { + ELOGF("CSD", "Set decoration SHADOW left.. size(%d)", ec, size); + ec->manage_resize.shadow.l = size; + } + else + { + ELOGF("CSD", "Unset decoration SHADOW left", ec); + ec->manage_resize.shadow.l = 0; + } + } + else if (!strncmp(hint->hint, hint_names[E_POLICY_HINT_DECORATION_SIZE_SHADOW_RIGHT], strlen(hint->hint))) + { + int size = atoi(hint->val); + if (size > 0) + { + ELOGF("CSD", "Set decoration SHADOW right.. size(%d)", ec, size); + ec->manage_resize.shadow.r = size; + } + else + { + ELOGF("CSD", "Unset decoration SHADOW right", ec); + ec->manage_resize.shadow.r = 0; } } } @@ -3578,17 +3626,17 @@ _tzpol_iface_cb_set_layout(struct wl_client *client EINA_UNUSED, struct wl_resou // TODO: We may need to adjust the last size if the unit size is not devided exactly - ELOGF("TZPOL", "TIZEN_POLICY_SET_LAYOUT... layout(%d,%d) request(%d,%d,%d,%d) -> unit(%d,%d), geo(%d,%d,%dx%d)", - ec, num_cols, num_rows, column, row, col_span, row_span, unit_w, unit_h, x, y, w, h); + ELOGF("TZPOL", "TIZEN_POLICY_SET_LAYOUT... total_layout(%d,%d) -> unit_size(%dx%d). request(%d,%d,%d,%d) -> geo(%d,%d,%dx%d)", + ec, num_cols, num_rows, unit_w, unit_h, column, row, col_span, row_span, x, y, w, h); - if (ec->manage_resize.shadow) - { - x -= ec->manage_resize.shadow; - y -= ec->manage_resize.shadow; - w = w + (ec->manage_resize.shadow * 2); - h = h + (ec->manage_resize.shadow * 2); - ELOGF("TZPOL", "Shadow is enabled.. Consider Shadow size(%d). new (%d,%d,%dx%d)", ec, ec->manage_resize.shadow, x, y, w, h); - } + // Apply shadow size (left, right, top, bottom) + x -= ec->manage_resize.shadow.l; + y -= ec->manage_resize.shadow.t; + w = w + ec->manage_resize.shadow.l + ec->manage_resize.shadow.r; + h = h + ec->manage_resize.shadow.t + ec->manage_resize.shadow.b; + + ELOGF("TZPOL", "Consider Shadow size(l:%d,r:%d,t:%d,b:%d). new (%d,%d,%dx%d)", + ec, ec->manage_resize.shadow.l, ec->manage_resize.shadow.r, ec->manage_resize.shadow.t, ec->manage_resize.shadow.b, x, y, w, h); e_client_frame_geometry_set(ec, x, y, w, h); } -- 2.7.4