From 10c43efc831edf771e198604ed5fffbe25c2fb5c Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Mon, 25 Jan 2016 13:45:47 -0500 Subject: [PATCH] fill zone obstacles on x/y axis during useful geometry recalc this fixes an issue where shrinking vertical shelves would cause vertically maximized windows to always match the height of the shelf possibly needs improving later depending on usage of zone obstacles in the future... --- src/bin/e_zone.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/bin/e_zone.c b/src/bin/e_zone.c index 2d02fd2e8..6c4682278 100644 --- a/src/bin/e_zone.c +++ b/src/bin/e_zone.c @@ -1239,7 +1239,10 @@ _e_zone_useful_geometry_calc(const E_Zone *zone, int dx, int dy, int *x, int *y, EINA_INLIST_FOREACH(zone->obstacles, obs) { if (!E_INTERSECTS(obs->x, obs->y, obs->w, obs->h, zx, zy, zw, zh)) continue; - eina_tiler_rect_del(tiler, &(Eina_Rectangle){obs->x - zx, obs->y - zy, obs->w, obs->h}); + if (obs->w >= obs->h) + eina_tiler_rect_del(tiler, &(Eina_Rectangle){0, obs->y - zy, zw, obs->h}); + else + eina_tiler_rect_del(tiler, &(Eina_Rectangle){obs->x - zx, 0, obs->w, zh}); } desk = e_desk_at_xy_get(zone, dx, dy); if (desk) @@ -1247,7 +1250,10 @@ _e_zone_useful_geometry_calc(const E_Zone *zone, int dx, int dy, int *x, int *y, EINA_INLIST_FOREACH(desk->obstacles, obs) { if (!E_INTERSECTS(obs->x, obs->y, obs->w, obs->h, zx, zy, zw, zh)) continue; - eina_tiler_rect_del(tiler, &(Eina_Rectangle){obs->x - zx, obs->y - zy, obs->w, obs->h}); + if (obs->w >= obs->h) + eina_tiler_rect_del(tiler, &(Eina_Rectangle){0, obs->y - zy, zw, obs->h}); + else + eina_tiler_rect_del(tiler, &(Eina_Rectangle){obs->x - zx, 0, obs->w, zh}); } } it = eina_tiler_iterator_new(tiler);