summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2018-01-22 14:18:03 -0500
committerMike Blumenkrantz <zmike@osg.samsung.com>2018-01-22 13:41:45 -0500
commitadc3c5ac81131b3a6b6e80c8f3f228623cbdfb6c (patch)
tree5f06080ea7d009e1c277eb50c422701aa0969008
parent7f649d078be14a47a66cee2c75097c579d10ccbc (diff)
downloadenlightenment-adc3c5ac81131b3a6b6e80c8f3f228623cbdfb6c.tar.gz
clamp large windows to desk's useful geometry if smart placement fails
in the case where a window does not place with the smart placement algorithm, clamp position to the top-left available position within the useful geometry so that the titlebar will always be visible
-rw-r--r--src/bin/e_place.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/bin/e_place.c b/src/bin/e_place.c
index 4c73594a4b..ff56ac69fd 100644
--- a/src/bin/e_place.c
+++ b/src/bin/e_place.c
@@ -418,9 +418,11 @@ done:
E_FREE(a_x);
E_FREE(a_y);
- if ((*rx + w) > desk->zone->x + desk->zone->w) *rx = desk->zone->x + desk->zone->w - w;
+ e_zone_desk_useful_geometry_get(desk->zone, desk, &zx, &zy, &zw, &zh);
+
+ if ((*rx + w) > zx + zw) *rx = zx + zw - w;
if (*rx < zx) *rx = zx;
- if ((*ry + h) > desk->zone->y + desk->zone->h) *ry = desk->zone->y + desk->zone->h - h;
+ if ((*ry + h) > zy + zh) *ry = zy + zh - h;
if (*ry < zy) *ry = zy;
// printf("0 - PLACE %i %i | %ix%i\n", *rx, *ry, w, h);