From: Doyoun Kang Date: Fri, 28 Apr 2023 08:11:14 +0000 (+0900) Subject: e_policy: add callback for E_EVENT_ZONE_USEFUL_GEOMETRY_CHANGE X-Git-Tag: accepted/tizen/unified/20230528.171009^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c3b5ae2149b0ffeea282cd644fd06dc6b7499f81;p=platform%2Fupstream%2Fenlightenment.git e_policy: add callback for E_EVENT_ZONE_USEFUL_GEOMETRY_CHANGE We add a E_EVENT_ZONE_USEFUL_GEOMETRY_CHANGE event callback function. If the useful geometry of E_Zone is changed, then we re-calculate the geometry of a maximize state windows. Change-Id: I1d2fcb026f630c082fb47643c8ba36575159c6ac --- diff --git a/src/bin/e_policy.c b/src/bin/e_policy.c index e2a3d30..8b05256 100644 --- a/src/bin/e_policy.c +++ b/src/bin/e_policy.c @@ -81,6 +81,7 @@ static Eina_Bool _e_policy_cb_zone_del(void *data EINA_UNUSED, int type EINA_U static Eina_Bool _e_policy_cb_zone_move_resize(void *data EINA_UNUSED, int type EINA_UNUSED, void *event); static Eina_Bool _e_policy_cb_zone_desk_count_set(void *data EINA_UNUSED, int type EINA_UNUSED, void *event); static Eina_Bool _e_policy_cb_zone_display_state_change(void *data EINA_UNUSED, int type EINA_UNUSED, void *event); +static Eina_Bool _e_policy_cb_zone_useful_geometry_change(void *data EINA_UNUSED, int type EINA_UNUSED, void *event); static Eina_Bool _e_policy_cb_desk_show(void *data EINA_UNUSED, int type EINA_UNUSED, void *event); static Eina_Bool _e_policy_cb_client_add(void *data EINA_UNUSED, int type, void *event); static Eina_Bool _e_policy_cb_client_move(void *data EINA_UNUSED, int type, void *event); @@ -1194,6 +1195,27 @@ _e_policy_cb_zone_display_state_change(void *data EINA_UNUSED, int type EINA_UNU } static Eina_Bool +_e_policy_cb_zone_useful_geometry_change(void *data EINA_UNUSED, int type EINA_UNUSED, void *event) +{ + E_Event_Zone_Useful_Geometry_Change *ev; + E_Client *ec; + + ev = event; + if (!ev) return ECORE_CALLBACK_PASS_ON; + + E_CLIENT_FOREACH(ec) + { + if (ev->zone != ec->zone) + continue; + + if (ec->maximized) + e_client_maximize_update(ec); + } + + return ECORE_CALLBACK_PASS_ON; +} + +static Eina_Bool _e_policy_cb_desk_show(void *data EINA_UNUSED, int type EINA_UNUSED, void *event) { E_Event_Desk_Show *ev; @@ -2404,6 +2426,7 @@ e_policy_init(void) E_LIST_HANDLER_APPEND(handlers, E_EVENT_ZONE_MOVE_RESIZE, _e_policy_cb_zone_move_resize, NULL); E_LIST_HANDLER_APPEND(handlers, E_EVENT_ZONE_DESK_COUNT_SET, _e_policy_cb_zone_desk_count_set, NULL); E_LIST_HANDLER_APPEND(handlers, E_EVENT_ZONE_DISPLAY_STATE_CHANGE, _e_policy_cb_zone_display_state_change, NULL); + E_LIST_HANDLER_APPEND(handlers, E_EVENT_ZONE_USEFUL_GEOMETRY_CHANGE, _e_policy_cb_zone_useful_geometry_change, NULL); E_LIST_HANDLER_APPEND(handlers, E_EVENT_DESK_SHOW, _e_policy_cb_desk_show, NULL); E_LIST_HANDLER_APPEND(handlers, E_EVENT_CLIENT_ADD, _e_policy_cb_client_add, NULL); E_LIST_HANDLER_APPEND(handlers, E_EVENT_CLIENT_MOVE, _e_policy_cb_client_move, NULL);