From dd42587f77a9b5e9b4f8d6f7947df9ff1a11c6e2 Mon Sep 17 00:00:00 2001 From: "Junseok, Kim" Date: Wed, 19 Aug 2020 22:27:04 +0900 Subject: [PATCH] e_policy_stack: adjust transient_for always on top hint if use wm.policy.win.transient_for.always_on_top aux hint, the ec's stack will be fixed topmost of transients. Change-Id: If532356abcd2efab3df3eeaafa207e1af733c28e Signed-off-by: Junseok, Kim --- src/bin/e_comp_wl_shell.c | 13 ++++++++++++- src/bin/e_policy_stack.c | 28 +++++++++++++++++++++++++++- 2 files changed, 39 insertions(+), 2 deletions(-) diff --git a/src/bin/e_comp_wl_shell.c b/src/bin/e_comp_wl_shell.c index f2060d4..4fbe8bb 100644 --- a/src/bin/e_comp_wl_shell.c +++ b/src/bin/e_comp_wl_shell.c @@ -154,8 +154,9 @@ e_shell_e_client_pong(E_Client *ec) EINTERN void e_shell_e_client_parent_set(E_Client *ec, struct wl_resource *parent_resource) { - E_Client *pc; + E_Client *pc, *child; Ecore_Window pwin = 0; + Eina_List *dup_transients = NULL; EINA_SAFETY_ON_NULL_RETURN(ec); @@ -206,6 +207,16 @@ e_shell_e_client_parent_set(E_Client *ec, struct wl_resource *parent_resource) ec->parent = pc; } + dup_transients = eina_list_clone(pc->transients); + EINA_LIST_FREE(dup_transients, child) + { + if (child->transient_for_always_on_top) + { + pc->transients = eina_list_remove(pc->transients, child); + pc->transients = eina_list_append(pc->transients, child); + } + } + ec->icccm.fetch.transient_for = EINA_TRUE; ec->icccm.transient_for = pwin; } diff --git a/src/bin/e_policy_stack.c b/src/bin/e_policy_stack.c index 6391e67..ccd021f 100644 --- a/src/bin/e_policy_stack.c +++ b/src/bin/e_policy_stack.c @@ -165,7 +165,21 @@ _e_policy_stack_transient_for_apply(E_Client *ec) break; } if ((top != ec) && (eina_list_data_find(ec->parent->transients, top))) - break; + { + if (top->transient_for_always_on_top) + { + if (e_policy_client_is_keyboard(ec) || + e_policy_client_is_keyboard_sub(ec)) + break; + else + { + top = e_client_below_get(top); + continue; + } + } + else + break; + } if (_e_policy_stack_transient_for_check_descendant(top, ec->parent)) break; @@ -308,8 +322,10 @@ e_policy_stack_hook_pre_fetch(E_Client *ec) void e_policy_stack_transient_for_set(E_Client *ec, E_Client *parent) { + E_Client *child = NULL; E_Policy_Stack *ps; Ecore_Window pwin = 0; + Eina_List *dup_transients = NULL; EINA_SAFETY_ON_NULL_RETURN(ec); @@ -353,6 +369,16 @@ e_policy_stack_transient_for_set(E_Client *ec, E_Client *parent) ec->parent = parent; } + dup_transients = eina_list_clone(ec->parent->transients); + EINA_LIST_FREE(dup_transients, child) + { + if (child->transient_for_always_on_top) + { + ec->parent->transients = eina_list_remove(ec->parent->transients, child); + ec->parent->transients = eina_list_append(ec->parent->transients, child); + } + } + ec->icccm.fetch.transient_for = EINA_TRUE; ec->icccm.transient_for = pwin; -- 2.7.4