- make the cursor placement code keep the window fully onscreen

SVN revision: 16779
This commit is contained in:
Dan Sinclair 2005-09-20 05:14:57 +00:00 committed by Dan Sinclair
parent 4f70f79b42
commit b56a8b947b
3 changed files with 21 additions and 4 deletions

View File

@ -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;

View File

@ -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;
}

View File

@ -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