forked from enlightenment/enlightenment
- make the cursor placement code keep the window fully onscreen
SVN revision: 16779
This commit is contained in:
parent
4f70f79b42
commit
b56a8b947b
|
@ -5015,8 +5015,8 @@ _e_border_eval(E_Border *bd)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
e_place_zone_cursor(bd->zone, bd->x, bd->w, bd->client_inset.t,
|
e_place_zone_cursor(bd->zone, bd->x, bd->y, bd->w, bd->h,
|
||||||
&new_x, &new_y);
|
bd->client_inset.t, &new_x, &new_y);
|
||||||
}
|
}
|
||||||
bd->x = new_x;
|
bd->x = new_x;
|
||||||
bd->y = new_y;
|
bd->y = new_y;
|
||||||
|
|
|
@ -451,15 +451,32 @@ e_place_zone_region_smart(E_Zone *zone, Evas_List *skiplist, int x, int y, int w
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
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 cursor_x = 0, cursor_y = 0;
|
||||||
|
int zone_right, zone_bottom;
|
||||||
|
|
||||||
E_OBJECT_CHECK(zone);
|
E_OBJECT_CHECK(zone);
|
||||||
|
|
||||||
ecore_x_pointer_xy_get(zone->container->win, &cursor_x, &cursor_y);
|
ecore_x_pointer_xy_get(zone->container->win, &cursor_x, &cursor_y);
|
||||||
*rx = cursor_x - ((w - x) >> 1);
|
*rx = cursor_x - ((w - x) >> 1);
|
||||||
*ry = cursor_y - (it >> 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;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
|
|
||||||
EAPI void e_place_zone_region_smart_cleanup(E_Zone *zone);
|
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_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
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue