diff options
author | racarr <racarr@d7aaf104-2d23-0410-ae22-9d23157bf5a3> | 2006-12-16 05:29:20 +0000 |
---|---|---|
committer | racarr <racarr@d7aaf104-2d23-0410-ae22-9d23157bf5a3> | 2006-12-16 05:29:20 +0000 |
commit | 4d97de70ae1c117ad4fd8c48ff66203c36d23b09 (patch) | |
tree | fe1b8be91cd747b099ad4a9891d2671e9f6f0865 | |
parent | a9b59442f874582386895e4748aaa8330c8e433b (diff) | |
download | marex-dev-4d97de70ae1c117ad4fd8c48ff66203c36d23b09.tar.gz marex-dev-4d97de70ae1c117ad4fd8c48ff66203c36d23b09.tar.bz2 |
Temporary...
git-svn-id: file:///beryl/trunk@1790 d7aaf104-2d23-0410-ae22-9d23157bf5a3
-rw-r--r-- | beryl-plugins/src/place.c | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/beryl-plugins/src/place.c b/beryl-plugins/src/place.c index 6cc93c4..48c6393 100644 --- a/beryl-plugins/src/place.c +++ b/beryl-plugins/src/place.c @@ -29,6 +29,7 @@ #include <glib.h> #define PLACE_WORKAROUND_DEFAULT TRUE +#define RECTANGLE_FROM_WINDOW(w) {w->attrib.x,w->attrib.y,w->attrib.width,w->attrib.height} static int displayPrivateIndex; @@ -272,27 +273,32 @@ static void placeRandom(CompWindow *window, int *x, int *y){ static void placeIntelligent(CompWindow *window, int *xo, int *yo){ int x = 0; int y = 0; - int x_optimal, y_optimal; - int xloc=window->attrib.x; int yloc=window->attrib.y; int height=window->attrib.height; int width=window->attrib.width; int tr=xloc+width; - int overlaps = 0; + XRectangle windowRec = RECTANGLE_FROM_WINDOW(window); + + Bool overlaps = FALSE; for (x = 0; x < window->screen->workArea.width; x++){ - overlaps=0; + overlaps=FALSE; for (y = 0; y < window->screen->workArea.height;y++){ CompScreen *l=window->screen->windows; while (l){ - if (((xloc + width/2) < (l->attrib.x + l->attrib.width + width) && (xloc>l->attrib.x)) || (tr + width/2) < (l->attrib.x + l->attrib.width + width) && (tr>l->attrib.x)){ - overlaps=1; - } else if (yloc < (l->attrib.y) && yloc > (l->attrib.y - l->attrib.height)) { - overlaps=1; + XRectangle dest; + XRectangle temp = RECTANGLE_FROM_WINDOW(l); + if (rectangleIntersect(&windowRec,&temp,&dest)){ + overlaps=TRUE; + } + + } - l++; + } + if (overlaps) {break;} } - if (overlaps){break;} + *xo=x; *yo=y; } -} + + static void find_next_cascade(CompWindow * window, |