From f0ae0e8d64cf84016b78a868f5738cd876ccae64 Mon Sep 17 00:00:00 2001 From: Carsten Haitzler Date: Thu, 1 Jun 2006 05:43:54 +0000 Subject: [PATCH] limit place coord to within the zone. SVN revision: 23044 --- TODO | 2 +- src/bin/e_place.c | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/TODO b/TODO index c43648b98..3b13a5df3 100644 --- a/TODO +++ b/TODO @@ -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.) ]]] diff --git a/src/bin/e_place.c b/src/bin/e_place.c index d88150b3b..76731b677 100644 --- a/src/bin/e_place.c +++ b/src/bin/e_place.c @@ -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;