From 291f4404f79083660586645c93a8fb33396e1b0c Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Thu, 31 Dec 2015 12:57:47 -0500 Subject: [PATCH] test given coordinates in smart window placement algorithm the coordinates passed to this function were never used or tested for being a valid placement location, resulting in any clients which started with a given position being moved to a pre-existing smart placement test case, usually the upper-left or lower-right corners of the screen fix T1106 --- src/bin/e_place.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/bin/e_place.c b/src/bin/e_place.c index 628c0000f..214cee243 100644 --- a/src/bin/e_place.c +++ b/src/bin/e_place.c @@ -333,6 +333,27 @@ e_place_desk_region_smart(E_Desk *desk, Eina_List *skiplist, int x, int y, int w int i, j; int area = 0x7fffffff; + if ((x <= (zw - w)) && + (y <= (zh - h))) + { + int ar = 0; + + ar = _e_place_coverage_client_add(desk, skiplist, ar, + x, y, + w, h); + if (e_config->window_placement_policy == E_WINDOW_PLACEMENT_SMART) + ar = _e_place_coverage_shelf_add(desk, ar, + x, y, + w, h); + if (ar < area) + { + area = ar; + *rx = x; + *ry = y; + if (ar == 0) goto done; + } + } + for (j = 0; j < a_h - 1; j++) { for (i = 0; i < a_w - 1; i++)