Enlightenment CVS committal Author : dj2 Project : e17 Module : apps/e
Dir : e17/apps/e/src/bin Modified Files: e_border.c e_place.c e_place.h Log Message: - make the cursor placement code keep the window fully onscreen =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_border.c,v retrieving revision 1.398 retrieving revision 1.399 diff -u -3 -r1.398 -r1.399 --- e_border.c 13 Sep 2005 05:19:25 -0000 1.398 +++ e_border.c 20 Sep 2005 05:14:57 -0000 1.399 @@ -5015,8 +5015,8 @@ } 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; =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_place.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -3 -r1.10 -r1.11 --- e_place.c 13 Sep 2005 05:19:25 -0000 1.10 +++ e_place.c 20 Sep 2005 05:14:57 -0000 1.11 @@ -451,15 +451,32 @@ } 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; } =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_place.h,v retrieving revision 1.7 retrieving revision 1.8 diff -u -3 -r1.7 -r1.8 --- e_place.h 13 Sep 2005 05:19:25 -0000 1.7 +++ e_place.h 20 Sep 2005 05:14:57 -0000 1.8 @@ -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 ------------------------------------------------------- SF.Net email is sponsored by: Tame your development challenges with Apache's Geronimo App Server. Download it for free - -and be entered to win a 42" plasma tv or your very own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs