discomfitor pushed a commit to branch enlightenment-0.20.

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

commit 57f7f4f5e065c426c20bbc8625a6fbeaf491bb26
Author: Mike Blumenkrantz <zm...@osg.samsung.com>
Date:   Thu May 12 12:10:48 2016 -0400

    force cursor placement to obey useful zone geometry
---
 src/bin/e_place.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/src/bin/e_place.c b/src/bin/e_place.c
index 57e0d67..3780c9d 100644
--- a/src/bin/e_place.c
+++ b/src/bin/e_place.c
@@ -435,6 +435,7 @@ e_place_zone_cursor(E_Zone *zone, int x EINA_UNUSED, int y 
EINA_UNUSED, int w, i
 {
    int cursor_x = 0, cursor_y = 0;
    int zone_right, zone_bottom;
+   int zx, zy, zw, zh;
 
    E_OBJECT_CHECK_RETURN(zone, 0);
 
@@ -442,14 +443,16 @@ e_place_zone_cursor(E_Zone *zone, int x EINA_UNUSED, int 
y EINA_UNUSED, int w, i
    *rx = cursor_x - (w >> 1);
    *ry = cursor_y - (it >> 1);
 
+   e_zone_useful_geometry_get(zone, &zx, &zy, &zw, &zh);
+
    if (*rx < zone->x)
-     *rx = zone->x;
+     *rx = zx;
 
    if (*ry < zone->y)
-     *ry = zone->y;
+     *ry = zy;
 
-   zone_right = zone->x + zone->w;
-   zone_bottom = zone->y + zone->h;
+   zone_right = zx + zw;
+   zone_bottom = zy + zh;
 
    if ((*rx + w) > zone_right)
      *rx = zone_right - w;

-- 


Reply via email to