summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2016-05-10 12:11:43 -0400
committerMike Blumenkrantz <zmike@osg.samsung.com>2016-05-10 12:13:12 -0400
commit16797009c01e743085a9fe50c8559cafbd5189d8 (patch)
tree4465f080fff77faf0bc1707f7fbc6ffa62b7fbad
parentac86429a2c878d688ff280720126e2c38baa9d3f (diff)
ensure child windows are placed on screen
when centering a child over its parent, checks were not made to ensure that by centering the child it had not gone offscreen
-rw-r--r--src/bin/e_client.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/bin/e_client.c b/src/bin/e_client.c
index d3a00a3e6..15a32ba74 100644
--- a/src/bin/e_client.c
+++ b/src/bin/e_client.c
@@ -1604,6 +1604,7 @@ _e_client_eval(E_Client *ec)
1604 { 1604 {
1605 if (ec->parent) 1605 if (ec->parent)
1606 { 1606 {
1607 Eina_Bool centered = EINA_FALSE;
1607 if (ec->parent->zone != e_zone_current_get()) 1608 if (ec->parent->zone != e_zone_current_get())
1608 { 1609 {
1609 e_client_zone_set(ec, ec->parent->zone); 1610 e_client_zone_set(ec, ec->parent->zone);
@@ -1630,6 +1631,7 @@ _e_client_eval(E_Client *ec)
1630 { 1631 {
1631 e_comp_object_util_center_on(ec->frame, 1632 e_comp_object_util_center_on(ec->frame,
1632 ec->parent->frame); 1633 ec->parent->frame);
1634 centered = 1;
1633 } 1635 }
1634 } 1636 }
1635 ec->changes.pos = 1; 1637 ec->changes.pos = 1;
@@ -1639,7 +1641,22 @@ _e_client_eval(E_Client *ec)
1639 { 1641 {
1640 e_comp_object_util_center_on(ec->frame, 1642 e_comp_object_util_center_on(ec->frame,
1641 ec->parent->frame); 1643 ec->parent->frame);
1642 ec->changes.pos = 1; 1644 centered = 1;
1645 }
1646 if (centered) //test for offscreen
1647 {
1648 if (!E_CONTAINS(ec->x, ec->y, ec->w, ec->h, zx, zy, zw, zh))
1649 {
1650 if (ec->x < zx)
1651 ec->x = ec->parent->x;
1652 if (ec->y < zy)
1653 ec->y = ec->parent->y;
1654 if (ec->x + ec->w > zx + zw)
1655 ec->x = ec->parent->x + ec->parent->w - ec->w;
1656 if (ec->y + ec->h > zy + zh)
1657 ec->y = ec->parent->y + ec->parent->h - ec->h;
1658 ec->changes.pos = 1;
1659 }
1643 } 1660 }
1644 ec->placed = 1; 1661 ec->placed = 1;
1645 ec->pre_cb.x = ec->x; ec->pre_cb.y = ec->y; 1662 ec->pre_cb.x = ec->x; ec->pre_cb.y = ec->y;