diff options
Diffstat (limited to 'beryl-plugins/src/place.c')
-rw-r--r-- | beryl-plugins/src/place.c | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/beryl-plugins/src/place.c b/beryl-plugins/src/place.c index cd7b5cc..5dbbe84 100644 --- a/beryl-plugins/src/place.c +++ b/beryl-plugins/src/place.c @@ -270,29 +270,30 @@ static void placeRandom(CompWindow *window, int *x, int *y){ *y = rand() % (window->screen->workArea.height - window->screen->workArea.y); } -static Bool windowIntersectsScreen(CompWindow *window){ - CompWindow *l = window->screen->reverseWindows; - Bool returnVal=TRUE; - XRectangle wRect; - getOuterRectOfWindow(window,&wRect); - - while (l){ - XRectangle lRect; - getOuterRectOfWindow(l,&lRect); - XRectangle temp; - if (rectangleIntersect(&lRect,&wRect,&temp)) {returnVal=FALSE;} - l++; - } - return returnVal; -} -static void placeIntelligent(CompWindow *window, int *x, int *y){ +static void placeIntelligent(CompWindow *w, int *x, int *y){ + + + + static int xi,yi,max; + *x=xi + (rand() % 10); + *y=yi + (rand() % 10); + xi+=w->attrib.width; + if (w->attrib.height > max){ + max=w->attrib.height; + } + if (xi > w->screen->workArea.width) { + xi=0; + yi+=max; + } + + +} + + - placeRandom(window,x,y); - /*TODO: Intelligent */ - } |