limit place coord to within the zone.

SVN revision: 23044
This commit is contained in:
Carsten Haitzler 2006-06-01 05:43:54 +00:00
parent a75b750f14
commit f0ae0e8d64
2 changed files with 15 additions and 1 deletions

2
TODO
View File

@ -55,7 +55,7 @@ Some of the things (in very short form) that need to be done to E17...
* gui config dialogs for all config
* make it possible to disable border buttons/actions (tell theme what is
disabled)
* shelf gui config is ugly and badly arranged
* shelf gui config needs a basic mode that is simpler.
* ibar should support creating and deleting bar dirs
* ibar labels need to be selected (name, generic, etc.)
]]]

View File

@ -157,6 +157,14 @@ e_place_zone_region_smart(E_Zone *zone, Evas_List *skiplist, int x, int y, int w
*ry = y;
return 1;
#endif
if ((w <= 0) || (h <= 0))
{
printf("EEEK! trying to place 0x0 window!!!!\n");
*rx = x;
*ry = y;
return 1;
}
/* FIXME: this NEEDS optimizing */
a_w = 2;
@ -468,6 +476,12 @@ e_place_zone_region_smart(E_Zone *zone, Evas_List *skiplist, int x, int y, int w
done:
E_FREE(a_x);
E_FREE(a_y);
if ((*rx + w) > zone->w) *rx = zone->w - w;
if (*rx < 0) *rx = 0;
if ((*ry + h) > zone->h) *ry = zone->h - h;
if (*ry < 0) *ry = 0;
*rx += zone->x;
*ry += zone->y;
return 1;