summaryrefslogtreecommitdiff
path: root/beryl-plugins/src/place.c
diff options
context:
space:
mode:
authorracarr <racarr@d7aaf104-2d23-0410-ae22-9d23157bf5a3>2006-12-16 05:49:16 +0000
committerracarr <racarr@d7aaf104-2d23-0410-ae22-9d23157bf5a3>2006-12-16 05:49:16 +0000
commitb82ea9c85f38aefa93f662d6f120266e4bbbffc0 (patch)
tree6e7176581ebdab8eee79abf210d2319ed9badca8 /beryl-plugins/src/place.c
parentf58b94840e4c8e66aaf44c38ca84fd8ba1acc62f (diff)
downloadmarex-dev-b82ea9c85f38aefa93f662d6f120266e4bbbffc0.tar.gz
marex-dev-b82ea9c85f38aefa93f662d6f120266e4bbbffc0.tar.bz2
Oh nevermind
git-svn-id: file:///beryl/trunk@1793 d7aaf104-2d23-0410-ae22-9d23157bf5a3
Diffstat (limited to 'beryl-plugins/src/place.c')
-rw-r--r--beryl-plugins/src/place.c46
1 files changed, 22 insertions, 24 deletions
diff --git a/beryl-plugins/src/place.c b/beryl-plugins/src/place.c
index 53aeee8..cd7b5cc 100644
--- a/beryl-plugins/src/place.c
+++ b/beryl-plugins/src/place.c
@@ -270,33 +270,31 @@ static void placeRandom(CompWindow *window, int *x, int *y){
*y = rand() % (window->screen->workArea.height - window->screen->workArea.y);
}
-static void placeIntelligent(CompWindow *window, int *xo, int *yo){
- int x = 0;
- int y = 0;
+static Bool windowIntersectsScreen(CompWindow *window){
+ CompWindow *l = window->screen->reverseWindows;
+ Bool returnVal=TRUE;
+ XRectangle wRect;
+ getOuterRectOfWindow(window,&wRect);
- XRectangle windowRec = RECTANGLE_FROM_WINDOW(window);
+ 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){
+
+ placeRandom(window,x,y);
+ /*TODO: Intelligent */
- Bool overlaps = FALSE;
- for (x = 0; x < window->screen->workArea.width; x+=(get_window_height(window))/10){
- overlaps=FALSE;
- for (y = 0; y < window->screen->workArea.height;y+=(get_window_width(window))/10){
- CompScreen *l=window->screen->windows;
- while (l){
- XRectangle dest;
- XRectangle temp = RECTANGLE_FROM_WINDOW(l);
- if (rectangleIntersect(&windowRec,&temp,&dest)){
- overlaps=TRUE;
- }
-
-
- }
-
-
- }
- if (overlaps) {break;}
- }
- *xo=300; *yo=300;
}
+
+