discomfitor pushed a commit to branch enlightenment-0.20. http://git.enlightenment.org/core/enlightenment.git/commit/?id=5b2cb3ddc777d5fac540cedfc138cb189e8c6a4d
commit 5b2cb3ddc777d5fac540cedfc138cb189e8c6a4d Author: Mike Blumenkrantz <zm...@osg.samsung.com> Date: Mon May 2 18:33:36 2016 -0400 further optimize window smart placement by reducing obstacle calcs previously the obstacle list would build from the bottom up, skipping fullscreen and maximized windows. this would lead to cases where windows would be moved to avoid windows which were fully obscured, and also cases where unnecessarily large amounts of looping would occur related to the existence of maximized windows --- src/bin/e_place.c | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/src/bin/e_place.c b/src/bin/e_place.c index 85698e2..e696abf 100644 --- a/src/bin/e_place.c +++ b/src/bin/e_place.c @@ -56,22 +56,29 @@ _e_place_cb_sort_cmp(const void *v1, const void *v2) } static Eina_Bool -ignore_client(const E_Client *ec, const Eina_List *skiplist) +ignore_client_and_break(const E_Client *ec) { - if (eina_list_data_find(skiplist, ec)) return EINA_TRUE; - if (e_client_util_ignored_get(ec)) return EINA_TRUE; - if (!evas_object_visible_get(ec->frame)) return EINA_TRUE; if (ec->fullscreen) return EINA_TRUE; if (ec->maximized) { - E_Maximize max = ec->maximized & E_MAXIMIZE_TYPE; + E_Maximize max = ec->maximized & E_MAXIMIZE_DIRECTION; if (max == E_MAXIMIZE_FULLSCREEN) return EINA_TRUE; - if (max & (E_MAXIMIZE_HORIZONTAL | E_MAXIMIZE_VERTICAL)) return EINA_TRUE; + if (max == E_MAXIMIZE_BOTH) return EINA_TRUE; } return EINA_FALSE; } +static Eina_Bool +ignore_client(const E_Client *ec, const Eina_List *skiplist) +{ + if (eina_list_data_find(skiplist, ec)) return EINA_TRUE; + if (e_client_util_ignored_get(ec)) return EINA_TRUE; + if (!evas_object_visible_get(ec->frame)) return EINA_TRUE; + + return EINA_FALSE; +} + static int _e_place_coverage_client_add(Eina_List *skiplist, int ar, int x, int y, int w, int h) { @@ -80,9 +87,10 @@ _e_place_coverage_client_add(Eina_List *skiplist, int ar, int x, int y, int w, i int iw, ih; int x0, x00, yy0, y00; - E_CLIENT_FOREACH(ec) + E_CLIENT_REVERSE_FOREACH(ec) { if (ignore_client(ec, skiplist)) continue; + if (ignore_client_and_break(ec)) break; x2 = ec->x; y2 = ec->y; w2 = ec->w; h2 = ec->h; if (E_INTERSECTS(x, y, w, h, x2, y2, w2, h2)) { @@ -261,11 +269,12 @@ e_place_desk_region_smart(E_Desk *desk, Eina_List *skiplist, int x, int y, int w } } - E_CLIENT_FOREACH(ec) + E_CLIENT_REVERSE_FOREACH(ec) { int bx, by, bw, bh; if (ignore_client(ec, skiplist)) continue; + if (ignore_client_and_break(ec)) break; bx = ec->x; by = ec->y; --