From fdaae59604fbda9c4c485c5b9779782cbfbdceaf Mon Sep 17 00:00:00 2001 From: Doyoun Kang Date: Mon, 19 Jul 2021 10:21:34 +0900 Subject: [PATCH] e_client: add APIs for setting/getting transient_policy we add APIs as below. - E_API void e_client_transient_policy_set(E_Client *ec, E_Transient policy) - E_API E_Transient e_client_transient_policy_get(E_Client *ec) Change-Id: I728e9f0da3c6110925c3721745e279abb449e0d3 --- src/bin/e_client.c | 30 +++++++++++++++++++++++------- src/bin/e_client.h | 3 +++ src/bin/e_comp_object.c | 2 +- src/bin/e_policy_stack.c | 13 +++++++------ src/bin/e_policy_visibility.c | 12 ++++++------ src/bin/e_test_helper.c | 4 ++-- 6 files changed, 42 insertions(+), 22 deletions(-) diff --git a/src/bin/e_client.c b/src/bin/e_client.c index 3a0a03d..19d2f4e 100644 --- a/src/bin/e_client.c +++ b/src/bin/e_client.c @@ -851,7 +851,7 @@ _e_client_check_obscured_by_children_group(E_Client *ec) EINA_LIST_FOREACH(transients, l, cec) { - if (cec->transient_policy == E_TRANSIENT_BELOW) + if (e_client_transient_policy_get(cec) == E_TRANSIENT_BELOW) continue; if (!E_CONTAINS(cec->x, cec->y, cec->w, cec->h, ec->x, ec->y, ec->w, ec->h)) @@ -2293,6 +2293,7 @@ _e_client_cb_evas_restack(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA { Eina_List *list = eina_list_clone(ec->transients); E_Client *child, *below = NULL, *above = NULL; + E_Transient transient_policy; E_LIST_REVERSE_FREE(list, child) { @@ -2311,7 +2312,8 @@ _e_client_cb_evas_restack(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA */ if (child->iconic && child->exp_iconify.by_client) continue; - if (child->transient_policy == E_TRANSIENT_ABOVE) + transient_policy = e_client_transient_policy_get(child); + if (transient_policy == E_TRANSIENT_ABOVE) { if (below) e_client_stack_below(child, below); @@ -2319,7 +2321,7 @@ _e_client_cb_evas_restack(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA e_client_stack_above(child, ec); below = child; } - else if (child->transient_policy == E_TRANSIENT_BELOW) + else if (transient_policy == E_TRANSIENT_BELOW) { if (above) e_client_stack_below(child, above); @@ -3203,7 +3205,7 @@ _e_client_transient_for_group_make(E_Client *ec, Eina_List **list) if (!child) continue; if (!child->iconic) { - if (child->transient_policy == E_TRANSIENT_ABOVE) + if (e_client_transient_policy_get(child) == E_TRANSIENT_ABOVE) { *list = eina_list_prepend(*list, child); _e_client_transient_for_group_make(child, list); @@ -3712,7 +3714,7 @@ _e_client_focus_calculate(E_Zone *zone) child_list = eina_list_clone(ec->transients); EINA_LIST_FOREACH(child_list, l, cec) { - if (cec->transient_policy == E_TRANSIENT_BELOW) continue; + if (e_client_transient_policy_get(cec) == E_TRANSIENT_BELOW) continue; if (!(cec->icccm.accepts_focus || cec->icccm.take_focus)) continue; if (eina_list_data_find(defer_focus_stack, cec)) { @@ -6244,7 +6246,7 @@ e_client_uniconify(E_Client *ec) EINA_LIST_FREE(list, child) { - if (child->transient_policy == E_TRANSIENT_BELOW) + if (e_client_transient_policy_get(child) == E_TRANSIENT_BELOW) { child->exp_iconify.not_raise = not_raise; e_client_uniconify(child); @@ -6291,7 +6293,7 @@ e_client_uniconify(E_Client *ec) EINA_LIST_FREE(list, child) { - if (child->transient_policy == E_TRANSIENT_ABOVE) + if (e_client_transient_policy_get(child) == E_TRANSIENT_ABOVE) { child->exp_iconify.not_raise = not_raise; e_client_uniconify(child); @@ -8422,3 +8424,17 @@ e_client_map_enable_set(E_Client *ec, Eina_Bool enable) return EINA_TRUE; } + +E_API void +e_client_transient_policy_set(E_Client *ec, E_Transient policy) +{ + if (!ec) return; + ec->transient_policy = policy; +} + +E_API E_Transient +e_client_transient_policy_get(E_Client *ec) +{ + if (!ec) return E_TRANSIENT_ABOVE; + return ec->transient_policy; +} diff --git a/src/bin/e_client.h b/src/bin/e_client.h index fe3832d..c1be87d 100644 --- a/src/bin/e_client.h +++ b/src/bin/e_client.h @@ -1275,6 +1275,9 @@ E_API Eina_Bool e_client_map_set(E_Client *ec, E_Map *em); E_API E_Map *e_client_map_get(const E_Client *ec); E_API Eina_Bool e_client_map_enable_set(E_Client *ec, Eina_Bool enabled); +E_API void e_client_transient_policy_set(E_Client *ec, E_Transient policy); +E_API E_Transient e_client_transient_policy_get(E_Client *ec); + /** * Move window to coordinates that do not account client decorations yet. * diff --git a/src/bin/e_comp_object.c b/src/bin/e_comp_object.c index 1d1d19f..8b3d94d 100644 --- a/src/bin/e_comp_object.c +++ b/src/bin/e_comp_object.c @@ -1812,7 +1812,7 @@ _e_comp_intercept_layer_set(void *data, Evas_Object *obj, int layer) } if (ec && (cw->ec->parent == ec)) { - if (cw->ec->transient_policy == E_TRANSIENT_ABOVE) + if (e_client_transient_policy_get(cw->ec) == E_TRANSIENT_ABOVE) evas_object_stack_above(obj, ec->frame); else evas_object_stack_below(obj, ec->frame); diff --git a/src/bin/e_policy_stack.c b/src/bin/e_policy_stack.c index 7ff05ed..a54f2ad 100644 --- a/src/bin/e_policy_stack.c +++ b/src/bin/e_policy_stack.c @@ -8,12 +8,12 @@ _e_policy_stack_transient_for_check_descendant(E_Client *ec, E_Client *ancestor, if (!ec) return EINA_FALSE; if (!ancestor) return EINA_FALSE; - if (ec->transient_policy != policy) return EINA_FALSE; + if (e_client_transient_policy_get(ec) != policy) return EINA_FALSE; parent = ec->parent; while (parent) { - if (parent->transient_policy != policy) + if (e_client_transient_policy_get(parent) != policy) return EINA_FALSE; if (eina_list_data_find(ancestor->transients, parent)) @@ -109,7 +109,8 @@ _e_policy_stack_transient_for_apply(E_Client *ec) } } - if (ec->transient_policy == E_TRANSIENT_ABOVE) + E_Transient transient_policy = e_client_transient_policy_get(ec); + if (transient_policy == E_TRANSIENT_ABOVE) { top = e_client_top_get(); while (top) @@ -155,7 +156,7 @@ _e_policy_stack_transient_for_apply(E_Client *ec) else e_client_stack_above(ec, ec->parent); } - else if (ec->transient_policy == E_TRANSIENT_BELOW) + else if (transient_policy == E_TRANSIENT_BELOW) { if (eina_list_count(ec->parent->transients) <= 1) e_client_stack_below(ec, ec->parent); @@ -178,7 +179,7 @@ _e_policy_stack_transient_for_apply(E_Client *ec) } } - if (bottom->transient_policy == E_TRANSIENT_BELOW) + if (e_client_transient_policy_get(bottom) == E_TRANSIENT_BELOW) break; } @@ -334,7 +335,7 @@ _e_policy_stack_transient_for_set(E_Client *ec, E_Client *parent, Eina_Bool tran if ((parent) && (parent != ec) && (eina_list_data_find(parent->transients, ec) != ec)) { - if (ec->transient_policy == E_TRANSIENT_BELOW) + if (e_client_transient_policy_get(ec) == E_TRANSIENT_BELOW) parent->transients = eina_list_prepend(parent->transients, ec); else parent->transients = eina_list_append(parent->transients, ec); diff --git a/src/bin/e_policy_visibility.c b/src/bin/e_policy_visibility.c index 6c20cfc..3bee452 100644 --- a/src/bin/e_policy_visibility.c +++ b/src/bin/e_policy_visibility.c @@ -182,7 +182,7 @@ _e_policy_check_transient_child_visible(E_Client *ancestor_ec, E_Client *ec) if (!child_ec->comp_data) continue; if (!child_ec->comp_data->mapped && !child_ec->use_splash) continue; - if (child_ec->transient_policy == E_TRANSIENT_BELOW) continue; + if (e_client_transient_policy_get(child_ec) == E_TRANSIENT_BELOW) continue; if ((child_ec->exp_iconify.skip_iconify == EINA_TRUE) || (child_ec->exp_iconify.skip_by_remote == EINA_TRUE)) @@ -1267,7 +1267,7 @@ _e_vis_client_check_obscured_by_children(E_Client *ec) EINA_LIST_FOREACH(ec->transients, l, child) { - if (child->transient_policy == E_TRANSIENT_BELOW) + if (e_client_transient_policy_get(child) == E_TRANSIENT_BELOW) continue; if (!child->argb) @@ -1453,7 +1453,7 @@ _e_vis_client_add_uniconify_render_pending(E_Vis_Client *vc, E_Vis_Job_Type type /* do not add child window which is obscured by 24 bit parent window */ if ((ec->parent) && !(ec->parent->argb) && - (ec->transient_policy == E_TRANSIENT_BELOW)) + (e_client_transient_policy_get(ec) == E_TRANSIENT_BELOW)) { VS_INF(ec, "Transient below. no need to uniconify render."); return EINA_FALSE; @@ -1811,7 +1811,7 @@ _e_vis_ec_below_activity_clients_get(E_Client *ec, Eina_List **below_list) E_VIS_CLIENT_GET(vc, below); if (!vc) continue; - if ((below->transient_policy == E_TRANSIENT_BELOW) && + if ((e_client_transient_policy_get(below) == E_TRANSIENT_BELOW) && (below->parent == ec)) continue; @@ -2018,7 +2018,7 @@ _e_vis_transient_group_make(E_Client *ec, Eina_List **list) if (child->bg_state) continue; - if (child->transient_policy == E_TRANSIENT_ABOVE) + if (e_client_transient_policy_get(child) == E_TRANSIENT_ABOVE) { *list = eina_list_prepend(*list, child); _e_vis_transient_group_make(child, list); @@ -2067,7 +2067,7 @@ _e_vis_intercept_show(void *data EINA_UNUSED, E_Client *ec) topmost = _e_vis_transient_top_get(ec); if (!topmost) return EINA_TRUE; - if (topmost->transient_policy == E_TRANSIENT_BELOW) + if (e_client_transient_policy_get(topmost) == E_TRANSIENT_BELOW) return EINA_TRUE; /* allow show if topmost child is alpha window or not fully cover region of ec */ diff --git a/src/bin/e_test_helper.c b/src/bin/e_test_helper.c index b5df382..176452e 100644 --- a/src/bin/e_test_helper.c +++ b/src/bin/e_test_helper.c @@ -1168,13 +1168,13 @@ _e_test_helper_cb_set_transient_for_below(const Eldbus_Service_Interface *iface if (set) { - ec->transient_policy = E_TRANSIENT_BELOW; + e_client_transient_policy_set(ec, E_TRANSIENT_BELOW); e_policy_stack_transient_for_set(ec, pec); accept = EINA_TRUE; } else { - ec->transient_policy = E_TRANSIENT_ABOVE; + e_client_transient_policy_set(ec, E_TRANSIENT_ABOVE); e_policy_stack_transient_for_set(ec, NULL); accept = EINA_TRUE; } -- 2.7.4