From: SooChan Lim Date: Thu, 6 Jul 2023 05:27:08 +0000 (+0900) Subject: e_policy: add e_policy at E_CLIENT_HOOK_NEW_CLIENT_POST instead of E_CLIENT_HOOK_NEW_... X-Git-Tag: accepted/tizen/unified/20230713.143510~12 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a671cefec84c15060f59208676be7436302985ca;p=platform%2Fupstream%2Fenlightenment.git e_policy: add e_policy at E_CLIENT_HOOK_NEW_CLIENT_POST instead of E_CLIENT_HOOK_NEW_CLIENT The callback of E_CLIENT_HOOK_NEW_CLIENT_POST knows the zone to which the e_client belongs. Change-Id: I0487729512d31986b04797ee6ee6dd4aa4542235 --- diff --git a/src/bin/e_policy.c b/src/bin/e_policy.c index c82a26d..5f5b5d8 100644 --- a/src/bin/e_policy.c +++ b/src/bin/e_policy.c @@ -142,6 +142,7 @@ _e_policy_client_add(E_Client *ec) if (!pc) return NULL; pc->ec = ec; + pc->zone = e_comp_zone_find_by_ec(ec); eina_hash_add(hash_policy_clients, &ec, pc); @@ -464,10 +465,11 @@ _e_policy_desk_get_by_num(unsigned int zone_num, int x, int y) return NULL; } - static void -_e_policy_cb_hook_client_new(void *d EINA_UNUSED, E_Client *ec) +_e_policy_cb_hook_client_new_post(void *d EINA_UNUSED, E_Client *ec) { + E_Policy_Client *pc; + if (EINA_UNLIKELY(!ec)) return; @@ -2247,7 +2249,7 @@ e_policy_init(void) E_LIST_HANDLER_APPEND(handlers, E_EVENT_CLIENT_SHOW, _e_policy_cb_client_show, NULL); E_LIST_HANDLER_APPEND(handlers, E_EVENT_CLIENT_HIDE, _e_policy_cb_client_hide, NULL); - E_CLIENT_HOOK_APPEND(hooks_ec, E_CLIENT_HOOK_NEW_CLIENT, _e_policy_cb_hook_client_new, NULL); + E_CLIENT_HOOK_APPEND(hooks_ec, E_CLIENT_HOOK_NEW_CLIENT_POST, _e_policy_cb_hook_client_new_post, NULL); E_CLIENT_HOOK_APPEND(hooks_ec, E_CLIENT_HOOK_DEL, _e_policy_cb_hook_client_del, NULL); E_CLIENT_HOOK_APPEND(hooks_ec, E_CLIENT_HOOK_EVAL_PRE_NEW_CLIENT, _e_policy_cb_hook_client_eval_pre_new_client, NULL); E_CLIENT_HOOK_APPEND(hooks_ec, E_CLIENT_HOOK_EVAL_PRE_FETCH, _e_policy_cb_hook_client_eval_pre_fetch, NULL); diff --git a/src/bin/e_policy.h b/src/bin/e_policy.h index 8dc67ad..7f2cfa7 100644 --- a/src/bin/e_policy.h +++ b/src/bin/e_policy.h @@ -108,6 +108,8 @@ struct _E_Policy_Desk struct _E_Policy_Client { E_Client *ec; + E_Zone *zone; + struct { E_Maximize maximized;