From: Doyoun Kang Date: Tue, 15 Jun 2021 03:20:55 +0000 (+0900) Subject: e_policy_stack: [2nd] apply stack policy for transient below X-Git-Tag: submit/tizen/20210709.022325^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F08%2F259808%2F7;p=platform%2Fupstream%2Fenlightenment.git e_policy_stack: [2nd] apply stack policy for transient below There was a case that the transient_below did not work. This change will fix it. This change is dependent on the below change. - policy: apply stack policy for transient below Change-Id: I3948a0b7948588ee3349e1c7f09099ae65de291e --- diff --git a/src/bin/e_policy_stack.c b/src/bin/e_policy_stack.c index 4ec752a677..7ff05eddc8 100644 --- a/src/bin/e_policy_stack.c +++ b/src/bin/e_policy_stack.c @@ -1,18 +1,22 @@ #include "e.h" Eina_Bool -_e_policy_stack_transient_for_check_descendant(E_Client *ec, E_Client *ancestor) +_e_policy_stack_transient_for_check_descendant(E_Client *ec, E_Client *ancestor, E_Transient policy) { E_Client *parent = NULL; Eina_Bool is_descendant = EINA_FALSE; if (!ec) return EINA_FALSE; if (!ancestor) return EINA_FALSE; + if (ec->transient_policy != policy) return EINA_FALSE; parent = ec->parent; while (parent) { - if (parent && (eina_list_data_find(ancestor->transients, parent))) + if (parent->transient_policy != policy) + return EINA_FALSE; + + if (eina_list_data_find(ancestor->transients, parent)) { is_descendant = EINA_TRUE; break; @@ -27,7 +31,7 @@ void _e_policy_stack_transient_for_apply(E_Client *ec) { int raise; - E_Client *child, *top; + E_Client *child, *top, *bottom; Eina_List *l; Eina_Bool intercepted = EINA_FALSE; @@ -117,10 +121,13 @@ _e_policy_stack_transient_for_apply(E_Client *ec) } if ((top != ec) && (eina_list_data_find(ec->parent->transients, top))) { - if (!e_client_mapped_get(top)) + if (!e_client_is_internal(top)) { - top = e_client_below_get(top); - continue; + if (!e_client_mapped_get(top)) + { + top = e_client_below_get(top); + continue; + } } if (top->transient_for_always_on_top) { @@ -136,7 +143,8 @@ _e_policy_stack_transient_for_apply(E_Client *ec) else break; } - if (_e_policy_stack_transient_for_check_descendant(top, ec->parent)) + + if (_e_policy_stack_transient_for_check_descendant(top, ec->parent, E_TRANSIENT_ABOVE)) break; top = e_client_below_get(top); @@ -149,7 +157,42 @@ _e_policy_stack_transient_for_apply(E_Client *ec) } else if (ec->transient_policy == E_TRANSIENT_BELOW) { - e_client_stack_below(ec, ec->parent); + if (eina_list_count(ec->parent->transients) <= 1) + e_client_stack_below(ec, ec->parent); + else + { + bottom = e_client_bottom_get(); + while (bottom) + { + if (bottom == ec->parent) + break; + + if ((bottom != ec) && (eina_list_data_find(ec->parent->transients, bottom))) + { + if (!e_client_is_internal(bottom)) + { + if (!e_client_mapped_get(bottom)) + { + bottom = e_client_above_get(bottom); + continue; + } + } + + if (bottom->transient_policy == E_TRANSIENT_BELOW) + break; + } + + if (_e_policy_stack_transient_for_check_descendant(bottom, ec->parent, E_TRANSIENT_BELOW)) + break; + + bottom = e_client_above_get(bottom); + } + + if (bottom) + e_client_stack_below(ec, bottom); + else + e_client_stack_below(ec, ec->parent); + } } } @@ -241,8 +284,8 @@ _e_policy_stack_transient_for_set(E_Client *ec, E_Client *parent, Eina_Bool tran EINA_SAFETY_ON_NULL_RETURN(ec); - ELOGF("POL", "Set Transient_stack. parent(win:%zx, ec:%p), is_transient_for:%d", - ec, e_client_util_win_get(parent), parent, transient); + ELOGF("POL", "Set Transient_stack. new parent(win:%zx, ec:%p) old parent(win:%zx, ec:%p), is_transient_for:%d", + ec, e_client_util_win_get(parent), parent, e_client_util_win_get(ec->parent), ec->parent, transient); if (!parent) {