From 3be7ce1be5c256aef6e47c5d977c3d246167517f Mon Sep 17 00:00:00 2001 From: "Mun, Gwan-gyeong" Date: Mon, 26 Jan 2015 23:45:36 +0900 Subject: [PATCH] Fix E_Client Stack traversal method on visibility calculate function. Change-Id: I804a80abfac2132e963db7d675823d3cfc84c96a --- src/e_mod_main.c | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ src/e_mod_visivility.c | 8 ++++---- 2 files changed, 53 insertions(+), 4 deletions(-) diff --git a/src/e_mod_main.c b/src/e_mod_main.c index a0fb593..82391c7 100644 --- a/src/e_mod_main.c +++ b/src/e_mod_main.c @@ -58,6 +58,9 @@ static Eina_Bool _pol_cb_zone_desk_count_set(void *data EINA_UNUSED, int type static Eina_Bool _pol_cb_desk_show(void *data EINA_UNUSED, int type EINA_UNUSED, void *event); static Eina_Bool _pol_cb_client_remove(void *data EINA_UNUSED, int type, void *event); static Eina_Bool _pol_cb_client_add(void *data EINA_UNUSED, int type, void *event); +static Eina_Bool _pol_cb_client_move(void *data EINA_UNUSED, int type, void *event); +static Eina_Bool _pol_cb_client_resize(void *data EINA_UNUSED, int type, void *event); +static Eina_Bool _pol_cb_client_stack(void *data EINA_UNUSED, int type, void *event); static Eina_Bool _pol_cb_window_property(void *data EINA_UNUSED, int type EINA_UNUSED, Ecore_X_Event_Window_Property *ev); static Eina_Bool _pol_cb_window_configure(void *data EINA_UNUSED, int type EINA_UNUSED, Ecore_X_Event_Window_Configure *ev); @@ -530,6 +533,45 @@ _pol_cb_client_add(void *data EINA_UNUSED, int type EINA_UNUSED, void *event) } static Eina_Bool +_pol_cb_client_move(void *data EINA_UNUSED, int type EINA_UNUSED, void *event) +{ + E_Event_Client *ev; + + ev = event; + if (!ev) return ECORE_CALLBACK_PASS_ON; + /* calculate e_client visibility */ + e_mod_pol_visibility_calc(); + + return ECORE_CALLBACK_PASS_ON; +} + +static Eina_Bool +_pol_cb_client_resize(void *data EINA_UNUSED, int type EINA_UNUSED, void *event) +{ + E_Event_Client *ev; + + ev = event; + if (!ev) return ECORE_CALLBACK_PASS_ON; + /* calculate e_client visibility */ + e_mod_pol_visibility_calc(); + + return ECORE_CALLBACK_PASS_ON; +} + +static Eina_Bool +_pol_cb_client_stack(void *data EINA_UNUSED, int type EINA_UNUSED, void *event) +{ + E_Event_Client *ev; + + ev = event; + if (!ev) return ECORE_CALLBACK_PASS_ON; + /* calculate e_client visibility */ + e_mod_pol_visibility_calc(); + + return ECORE_CALLBACK_PASS_ON; +} + +static Eina_Bool _pol_cb_window_property(void *data EINA_UNUSED, int type EINA_UNUSED, Ecore_X_Event_Window_Property *ev) { if (ev->atom == E_MOD_POL_ATOM_WINDOW_OPAQUE) @@ -789,6 +831,13 @@ e_modapi_init(E_Module *m) _pol_cb_client_remove, NULL); E_LIST_HANDLER_APPEND(handlers, E_EVENT_CLIENT_ADD, _pol_cb_client_add, NULL); + E_LIST_HANDLER_APPEND(handlers, E_EVENT_CLIENT_MOVE, + _pol_cb_client_move, NULL); + E_LIST_HANDLER_APPEND(handlers, E_EVENT_CLIENT_RESIZE, + _pol_cb_client_resize, NULL); + E_LIST_HANDLER_APPEND(handlers, E_EVENT_CLIENT_STACK, + _pol_cb_client_stack, NULL); + E_LIST_HANDLER_APPEND(handlers, ECORE_X_EVENT_WINDOW_PROPERTY, _pol_cb_window_property, NULL); E_LIST_HANDLER_APPEND(handlers, ECORE_X_EVENT_WINDOW_CONFIGURE, diff --git a/src/e_mod_visivility.c b/src/e_mod_visivility.c index e2b22ee..44a8a61 100644 --- a/src/e_mod_visivility.c +++ b/src/e_mod_visivility.c @@ -177,7 +177,6 @@ _client_tiler_intersects(E_Client *ec, Eina_Tiler *t) void e_mod_pol_zone_visibility_calc(E_Zone *zone) { - Eina_List *l; E_Client *ec; Eina_Tiler *t; Eina_Rectangle r; @@ -194,8 +193,9 @@ e_mod_pol_zone_visibility_calc(E_Zone *zone) EINA_RECTANGLE_SET(&r, zone->x, zone->y, zone->w, zone->h); eina_tiler_rect_add(t, &r); - EINA_LIST_REVERSE_FOREACH(zone->comp->clients, l, ec) + E_CLIENT_REVERSE_FOREACH(zone->comp, ec) { + if (e_object_is_del(E_OBJECT(ec))) continue; if (e_client_util_ignored_get(ec)) continue; /* check zone and skip borders not on this zone */ if (ec->zone != zone) continue; @@ -204,9 +204,9 @@ e_mod_pol_zone_visibility_calc(E_Zone *zone) /* check e_client and skip e_clinets not intersects with zone */ if (!E_INTERSECTS(ec->x, ec->y, ec->w, ec->h, zone->x, zone->y, zone->w, zone->h)) continue; - + if (_client_tiler_intersects(ec, t)) - { + { Pol_Win_Opaque *pwo; Eina_Bool opaque = EINA_FALSE; /* unobscured case */ -- 2.7.4