discomfitor pushed a commit to branch master.

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

commit b92fb1af3e8ef6ed00e4322fa3e096a2f1631a52
Author: Mike Blumenkrantz <[email protected]>
Date:   Fri Feb 21 17:41:35 2014 -0500

    fix visibility checks for shelves in client smart placement
---
 src/bin/e_place.c | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/src/bin/e_place.c b/src/bin/e_place.c
index 7086f6b..283f272 100644
--- a/src/bin/e_place.c
+++ b/src/bin/e_place.c
@@ -89,15 +89,16 @@ _e_place_coverage_client_add(E_Desk *desk, Eina_List 
*skiplist, int ar, int x, i
 }
 
 static int
-_e_place_coverage_shelf_add(E_Zone *zone, int ar, int x, int y, int w, int h)
+_e_place_coverage_shelf_add(E_Desk *desk, int ar, int x, int y, int w, int h)
 {
    Eina_List *l;
    E_Shelf *es;
    int x2, y2, w2, h2;
 
-   EINA_LIST_FOREACH(e_shelf_list(), l, es)
+   l = e_shelf_list_all();
+   EINA_LIST_FREE(l, es)
      {
-        if (es->zone != zone) continue;
+        if (!e_shelf_desk_visible(es, desk)) continue;
         x2 = es->x; y2 = es->y; w2 = es->w; h2 = es->h;
         if (E_INTERSECTS(x, y, w, h, x2, y2, w2, h2))
           {
@@ -172,11 +173,12 @@ e_place_desk_region_smart(E_Desk *desk, Eina_List 
*skiplist, int x, int y, int w
         Eina_List *l;
         E_Shelf *es;
 
-        EINA_LIST_FOREACH(e_shelf_list(), l, es)
+        l = e_shelf_list_all();
+        EINA_LIST_FREE(l, es)
           {
              int bx, by, bw, bh;
 
-             if (es->zone != desk->zone) continue;
+             if (!e_shelf_desk_visible(es, desk)) continue;
 
              bx = es->x;
              by = es->y;
@@ -344,7 +346,7 @@ e_place_desk_region_smart(E_Desk *desk, Eina_List 
*skiplist, int x, int y, int w
                                                        a_x[i], a_y[j],
                                                        w, h);
                      if (e_config->window_placement_policy == 
E_WINDOW_PLACEMENT_SMART)
-                       ar = _e_place_coverage_shelf_add(desk->zone, ar,
+                       ar = _e_place_coverage_shelf_add(desk, ar,
                                                         a_x[i], a_y[j],
                                                         w, h);
                      if (ar < area)
@@ -363,7 +365,7 @@ e_place_desk_region_smart(E_Desk *desk, Eina_List 
*skiplist, int x, int y, int w
                                                        a_x[i + 1] - w, a_y[j],
                                                        w, h);
                      if (e_config->window_placement_policy == 
E_WINDOW_PLACEMENT_SMART)
-                       ar = _e_place_coverage_shelf_add(desk->zone, ar,
+                       ar = _e_place_coverage_shelf_add(desk, ar,
                                                         a_x[i + 1] - w, a_y[j],
                                                         w, h);
                      if (ar < area)
@@ -382,7 +384,7 @@ e_place_desk_region_smart(E_Desk *desk, Eina_List 
*skiplist, int x, int y, int w
                                                        a_x[i + 1] - w, a_y[j + 
1] - h,
                                                        w, h);
                      if (e_config->window_placement_policy == 
E_WINDOW_PLACEMENT_SMART)
-                       ar = _e_place_coverage_shelf_add(desk->zone, ar,
+                       ar = _e_place_coverage_shelf_add(desk, ar,
                                                         a_x[i + 1] - w, a_y[j 
+ 1] - h,
                                                         w, h);
                      if (ar < area)
@@ -401,7 +403,7 @@ e_place_desk_region_smart(E_Desk *desk, Eina_List 
*skiplist, int x, int y, int w
                                                        a_x[i], a_y[j + 1] - h,
                                                        w, h);
                      if (e_config->window_placement_policy == 
E_WINDOW_PLACEMENT_SMART)
-                       ar = _e_place_coverage_shelf_add(desk->zone, ar,
+                       ar = _e_place_coverage_shelf_add(desk, ar,
                                                         a_x[i], a_y[j + 1] - h,
                                                         w, h);
                      if (ar < area)

-- 


Reply via email to