diff --git a/src/bin/e_border.c b/src/bin/e_border.c index 6aeafcb8d..53cde995c 100644 --- a/src/bin/e_border.c +++ b/src/bin/e_border.c @@ -6467,23 +6467,25 @@ _e_border_eval(E_Border *bd) bd->y = att->y; } - /* - * This code ensures that even if app windows like to open - * in stupid places (e.g. below shelfes) it moves them smart away - */ - /*{ - Eina_List *skiplist = NULL; - int new_x, new_y; - - skiplist = eina_list_append(skiplist, bd); - e_place_zone_region_smart(bd->zone, skiplist, - bd->x, bd->y, bd->w, bd->h, - &new_x, &new_y); - eina_list_free(skiplist); - bd->x += new_x; - bd->y += new_y; - }*/ + /* + * This ensures that windows that like to open with a x/y + * position smaller than returned by e_zone_useful_geometry_get() + * are moved to useful positions. + */ + // -> + if (bd->x < zx) + bd->x = zx; + + if (bd->y < zy) + bd->y = zy; + if (bd->x + bd->w > zw) + bd->x = zx + zw - bd->w; + + if (bd->y + bd->h > zh) + bd->y = zy + zh - bd->h; + // <-- + if (e_container_zone_at_point_get(bd->zone->container, bd->x, bd->y)) { bd->changes.pos = 1;