summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2016-05-12 12:10:48 -0400
committerMike Blumenkrantz <zmike@osg.samsung.com>2016-05-12 12:10:48 -0400
commit189dce81f97f2eefa4891fee4d8fa5dc50a886a6 (patch)
tree90ccf1827c98a99e9fac32bea1f49f4f6d59239d
parent2854352bc8b092eb82890b88987495d91df020c1 (diff)
force cursor placement to obey useful zone geometry
-rw-r--r--src/bin/e_place.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/bin/e_place.c b/src/bin/e_place.c
index f553ac4fc..fe272e41e 100644
--- a/src/bin/e_place.c
+++ b/src/bin/e_place.c
@@ -451,6 +451,7 @@ e_place_zone_cursor(E_Zone *zone, int x EINA_UNUSED, int y EINA_UNUSED, int w, i
451{ 451{
452 int cursor_x = 0, cursor_y = 0; 452 int cursor_x = 0, cursor_y = 0;
453 int zone_right, zone_bottom; 453 int zone_right, zone_bottom;
454 int zx, zy, zw, zh;
454 455
455 E_OBJECT_CHECK_RETURN(zone, 0); 456 E_OBJECT_CHECK_RETURN(zone, 0);
456 457
@@ -458,14 +459,16 @@ e_place_zone_cursor(E_Zone *zone, int x EINA_UNUSED, int y EINA_UNUSED, int w, i
458 *rx = cursor_x - (w >> 1); 459 *rx = cursor_x - (w >> 1);
459 *ry = cursor_y - (it >> 1); 460 *ry = cursor_y - (it >> 1);
460 461
462 e_zone_useful_geometry_get(zone, &zx, &zy, &zw, &zh);
463
461 if (*rx < zone->x) 464 if (*rx < zone->x)
462 *rx = zone->x; 465 *rx = zx;
463 466
464 if (*ry < zone->y) 467 if (*ry < zone->y)
465 *ry = zone->y; 468 *ry = zy;
466 469
467 zone_right = zone->x + zone->w; 470 zone_right = zx + zw;
468 zone_bottom = zone->y + zone->h; 471 zone_bottom = zy + zh;
469 472
470 if ((*rx + w) > zone_right) 473 if ((*rx + w) > zone_right)
471 *rx = zone_right - w; 474 *rx = zone_right - w;