From 0c202c11a8a1248c3120a523aba5bc01a8ed9bb7 Mon Sep 17 00:00:00 2001 From: Doyoun Kang Date: Mon, 17 Dec 2018 16:54:49 +0900 Subject: [PATCH] transient_for: apply transient_for stack while handling map window We add code to change window stack if it has a transient_for window when it is mapped. For this, enlihghtenment does not send pre-visibility event when the window which set transient_for to fully-obscured parent is mapped. Change-Id: Ie96081f84277893cfbba9c283b4725867021992d --- src/bin/e_comp_wl_shell.c | 9 +++++++++ src/bin/e_policy.h | 2 ++ src/bin/e_policy_stack.c | 27 ++++++++++++++++++++++++--- 3 files changed, 35 insertions(+), 3 deletions(-) diff --git a/src/bin/e_comp_wl_shell.c b/src/bin/e_comp_wl_shell.c index 1aebf1e2c9..229772c614 100644 --- a/src/bin/e_comp_wl_shell.c +++ b/src/bin/e_comp_wl_shell.c @@ -739,6 +739,15 @@ _e_shell_client_map_common_post(E_Client *ec) if ((!ec->iconic) && (!e_client_util_ignored_get(ec))) { + if (ec->icccm.fetch.transient_for) + { + e_policy_stack_transient_for_apply(ec); + ec->icccm.fetch.transient_for = 0; + + ec->post_lower = EINA_FALSE; + ec->post_raise = EINA_FALSE; + } + if (!ec->comp_data->sub.data) { if (ec->post_lower) diff --git a/src/bin/e_policy.h b/src/bin/e_policy.h index b0b70015e5..f26edb185f 100644 --- a/src/bin/e_policy.h +++ b/src/bin/e_policy.h @@ -220,6 +220,8 @@ EINTERN void e_policy_client_window_opaque_set(E_Client *ec); EINTERN void e_policy_stack_init(void); EINTERN void e_policy_stack_shutdown(void); EINTERN void e_policy_stack_transient_for_set(E_Client *child, E_Client *parent); +EINTERN void e_policy_stack_transient_for_apply(E_Client *ec); + EINTERN void e_policy_stack_cb_client_remove(E_Client *ec); EINTERN void e_policy_stack_hook_pre_fetch(E_Client *ec); EINTERN void e_policy_stack_hook_pre_post_fetch(E_Client *ec); diff --git a/src/bin/e_policy_stack.c b/src/bin/e_policy_stack.c index a36ea6025c..358b7b94ed 100644 --- a/src/bin/e_policy_stack.c +++ b/src/bin/e_policy_stack.c @@ -145,8 +145,8 @@ _e_policy_stack_transient_for_tree_check(E_Client *child, E_Client *parent) return EINA_FALSE; } -void -e_policy_stack_hook_pre_post_fetch(E_Client *ec) +static void +_e_policy_stack_fetch_transient(E_Client *ec) { E_Client *new_focus = NULL; E_Policy_Stack *ps; @@ -186,7 +186,13 @@ e_policy_stack_hook_pre_post_fetch(E_Client *ec) } void -e_policy_stack_hook_pre_fetch(E_Client *ec) +e_policy_stack_hook_pre_post_fetch(E_Client *ec) +{ + _e_policy_stack_fetch_transient(ec); +} + +static void +_e_policy_stack_fetch_icccm_transient_for(E_Client *ec) { if (ec->icccm.fetch.transient_for) { @@ -224,6 +230,12 @@ e_policy_stack_hook_pre_fetch(E_Client *ec) } } +void +e_policy_stack_hook_pre_fetch(E_Client *ec) +{ + _e_policy_stack_fetch_icccm_transient_for(ec); +} + void e_policy_stack_transient_for_set(E_Client *ec, E_Client *parent) { @@ -281,6 +293,15 @@ e_policy_stack_transient_for_set(E_Client *ec, E_Client *parent) EC_CHANGED(ec); } +void +e_policy_stack_transient_for_apply(E_Client *ec) +{ + if (!ec) return; + + _e_policy_stack_fetch_icccm_transient_for(ec); + _e_policy_stack_fetch_transient(ec); +} + void e_policy_stack_cb_client_remove(E_Client *ec) { -- 2.34.1