diff options
author | racarr <racarr@d7aaf104-2d23-0410-ae22-9d23157bf5a3> | 2006-12-16 07:24:41 +0000 |
---|---|---|
committer | racarr <racarr@d7aaf104-2d23-0410-ae22-9d23157bf5a3> | 2006-12-16 07:24:41 +0000 |
commit | 3ee1de9c98ee2d41c370674436d20f7cd0756767 (patch) | |
tree | 07d974afaca8ec7ee1703a64b63d6a0615a5271a /beryl-plugins | |
parent | b82ea9c85f38aefa93f662d6f120266e4bbbffc0 (diff) | |
download | marex-dev-3ee1de9c98ee2d41c370674436d20f7cd0756767.tar.gz marex-dev-3ee1de9c98ee2d41c370674436d20f7cd0756767.tar.bz2 |
Just going to stick a simple and functional algorithm in until I can get something better....vaugely tiles windows so they 'fit'
git-svn-id: file:///beryl/trunk@1794 d7aaf104-2d23-0410-ae22-9d23157bf5a3
Diffstat (limited to 'beryl-plugins')
-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 */ - } |