discomfitor pushed a commit to branch enlightenment-0.20.

http://git.enlightenment.org/core/enlightenment.git/commit/?id=fa7222ac4ce36f544d2340943112bcc75cfe397f

commit fa7222ac4ce36f544d2340943112bcc75cfe397f
Author: Mike Blumenkrantz <zm...@osg.samsung.com>
Date:   Thu Dec 31 12:57:47 2015 -0500

    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 628c000..214cee2 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++)

-- 


Reply via email to