diff --git a/src/bin/e_border.c b/src/bin/e_border.c index 88d138fcb..5e1ba0762 100644 --- a/src/bin/e_border.c +++ b/src/bin/e_border.c @@ -5015,8 +5015,8 @@ _e_border_eval(E_Border *bd) } else { - e_place_zone_cursor(bd->zone, bd->x, bd->w, bd->client_inset.t, - &new_x, &new_y); + e_place_zone_cursor(bd->zone, bd->x, bd->y, bd->w, bd->h, + bd->client_inset.t, &new_x, &new_y); } bd->x = new_x; bd->y = new_y; diff --git a/src/bin/e_place.c b/src/bin/e_place.c index 7e5beee0d..3750e336b 100644 --- a/src/bin/e_place.c +++ b/src/bin/e_place.c @@ -451,15 +451,32 @@ e_place_zone_region_smart(E_Zone *zone, Evas_List *skiplist, int x, int y, int w } int -e_place_zone_cursor(E_Zone *zone, int x, int w, int it, int *rx, int *ry) +e_place_zone_cursor(E_Zone *zone, int x, int y, int w, int h, int it, int *rx, int *ry) { int cursor_x = 0, cursor_y = 0; + int zone_right, zone_bottom; E_OBJECT_CHECK(zone); ecore_x_pointer_xy_get(zone->container->win, &cursor_x, &cursor_y); *rx = cursor_x - ((w - x) >> 1); *ry = cursor_y - (it >> 1); + + if (*rx < zone->x) + *rx = zone->x; + + if (*ry < zone->y) + *ry = zone->y; + + zone_right = zone->x + zone->w; + zone_bottom = zone->y + zone->h; + + if ((*rx + w) > zone_right) + *rx = zone_right - w; + + if ((*ry + h) > zone_bottom) + *ry = zone_bottom - h; + return 1; } diff --git a/src/bin/e_place.h b/src/bin/e_place.h index b4058d67a..890c566b7 100644 --- a/src/bin/e_place.h +++ b/src/bin/e_place.h @@ -8,7 +8,7 @@ EAPI void e_place_zone_region_smart_cleanup(E_Zone *zone); EAPI int e_place_zone_region_smart(E_Zone *zone, Evas_List *skiplist, int x, int y, int w, int h, int *rx, int *ry); -EAPI int e_place_zone_cursor(E_Zone *zone, int x, int w, int it, int *rx, int *ry); +EAPI int e_place_zone_cursor(E_Zone *zone, int x, int y, int w, int h, int it, int *rx, int *ry); #endif #endif