From 6e46d3699f9af627321ab0259b1f6041de96ba59 Mon Sep 17 00:00:00 2001 From: MinJeong Kim Date: Thu, 4 Aug 2016 19:02:45 +0900 Subject: [PATCH] e_policy: expose allow user geometry set function Change-Id: I80e1d98d2ba69824b1534f32a3d7fe2bf7bfef11 Signed-off-by: MinJeong Kim --- src/bin/e_policy.c | 82 +++++++++++++++++++++++++++--------------------------- src/bin/e_policy.h | 2 +- 2 files changed, 42 insertions(+), 42 deletions(-) diff --git a/src/bin/e_policy.c b/src/bin/e_policy.c index dec1667..9020702 100644 --- a/src/bin/e_policy.c +++ b/src/bin/e_policy.c @@ -1010,47 +1010,6 @@ _e_policy_cb_idle_enterer(void *data EINA_UNUSED) } void -e_policy_allow_user_geometry_set(E_Client *ec, Eina_Bool set) -{ - E_Policy_Client *pc; - - if (EINA_UNLIKELY(!ec)) - return; - - pc = eina_hash_find(hash_policy_clients, &ec); - if (EINA_UNLIKELY(!pc)) - return; - - if (set) pc->user_geom_ref++; - else pc->user_geom_ref--; - - if (pc->user_geom_ref == 1 && !pc->allow_user_geom) - { - pc->allow_user_geom = EINA_TRUE; - - if (!e_policy_client_is_noti(ec)) - { - ec->netwm.type = E_WINDOW_TYPE_UTILITY; - ec->lock_client_location = EINA_FALSE; - } - - ec->lock_client_size = EINA_FALSE; - ec->placed = 1; - EC_CHANGED(ec); - } - else if (pc->user_geom_ref == 0 && pc->allow_user_geom) - { - pc->allow_user_geom = EINA_FALSE; - - ec->lock_client_location = EINA_TRUE; - ec->lock_client_size = EINA_TRUE; - ec->placed = 0; - ec->netwm.type = E_WINDOW_TYPE_NORMAL; - EC_CHANGED(ec); - } -} - -void e_policy_desk_add(E_Desk *desk) { E_Policy_Desk *pd; @@ -1436,6 +1395,47 @@ e_policy_interceptor_del(E_Policy_Interceptor *pi) } E_API void +e_policy_allow_user_geometry_set(E_Client *ec, Eina_Bool set) +{ + E_Policy_Client *pc; + + if (EINA_UNLIKELY(!ec)) + return; + + pc = eina_hash_find(hash_policy_clients, &ec); + if (EINA_UNLIKELY(!pc)) + return; + + if (set) pc->user_geom_ref++; + else pc->user_geom_ref--; + + if (pc->user_geom_ref == 1 && !pc->allow_user_geom) + { + pc->allow_user_geom = EINA_TRUE; + + if (!e_policy_client_is_noti(ec)) + { + ec->netwm.type = E_WINDOW_TYPE_UTILITY; + ec->lock_client_location = EINA_FALSE; + } + + ec->lock_client_size = EINA_FALSE; + ec->placed = 1; + EC_CHANGED(ec); + } + else if (pc->user_geom_ref == 0 && pc->allow_user_geom) + { + pc->allow_user_geom = EINA_FALSE; + + ec->lock_client_location = EINA_TRUE; + ec->lock_client_size = EINA_TRUE; + ec->placed = 0; + ec->netwm.type = E_WINDOW_TYPE_NORMAL; + EC_CHANGED(ec); + } +} + +E_API void e_policy_deferred_job(void) { if (!e_policy) return; diff --git a/src/bin/e_policy.h b/src/bin/e_policy.h index bdb7554..5bf789a 100644 --- a/src/bin/e_policy.h +++ b/src/bin/e_policy.h @@ -104,7 +104,6 @@ extern E_Policy_System_Info e_policy_system_info; EINTERN E_Policy_Config_Desk *e_policy_conf_desk_get_by_nums(E_Policy_Config *conf, unsigned int zone_num, int x, int y); EINTERN E_Policy_Client *e_policy_client_get(E_Client *ec); -EINTERN void e_policy_allow_user_geometry_set(E_Client *ec, Eina_Bool set); EINTERN void e_policy_desk_add(E_Desk *desk); EINTERN void e_policy_desk_del(E_Policy_Desk *pd); EINTERN E_Policy_Client *e_policy_client_launcher_get(E_Zone *zone); @@ -157,6 +156,7 @@ E_API void e_policy_aux_message_send(E_Client *ec, const char *key, const c E_API E_Policy_Interceptor *e_policy_interceptor_add(E_Policy_Intercept_Point ipoint, E_Policy_Intercept_Cb func, const void *data); E_API void e_policy_interceptor_del(E_Policy_Interceptor *pi); +E_API void e_policy_allow_user_geometry_set(E_Client *ec, Eina_Bool set); E_API void e_policy_deferred_job(void); E_API int e_policy_init(void); E_API int e_policy_shutdown(void); -- 2.7.4