diff options
author | Mike Blumenkrantz <zmike@osg.samsung.com> | 2016-05-02 18:33:36 -0400 |
---|---|---|
committer | Mike Blumenkrantz <zmike@osg.samsung.com> | 2016-05-02 18:37:17 -0400 |
commit | 53e0bf08bcbaabfaac73bf7e97a4d15883a4ae65 (patch) | |
tree | 6e15214cd6c9e8d985dc395e1803a2c41a2580eb /src/bin/e_place.c | |
parent | 049deb2c126a2087d572b382415c4c5b06471e77 (diff) | |
download | enlightenment-53e0bf08bcbaabfaac73bf7e97a4d15883a4ae65.tar.gz |
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
Diffstat (limited to 'src/bin/e_place.c')
-rw-r--r-- | src/bin/e_place.c | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/src/bin/e_place.c b/src/bin/e_place.c index f615f74027..adb3e5866a 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)) { @@ -277,11 +285,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; |