summaryrefslogtreecommitdiff
path: root/beryl-plugins/src/place.c
diff options
context:
space:
mode:
authorracarr <racarr@d7aaf104-2d23-0410-ae22-9d23157bf5a3>2006-12-18 21:49:46 +0000
committerracarr <racarr@d7aaf104-2d23-0410-ae22-9d23157bf5a3>2006-12-18 21:49:46 +0000
commita106db73796d6843626bb64c300bd5beabb34a36 (patch)
tree8c4031222e309da2697f237e2e16c948e25538e6 /beryl-plugins/src/place.c
parent13a74317e48128f26031ec641f1d0e751826fbe2 (diff)
downloadmarex-dev-a106db73796d6843626bb64c300bd5beabb34a36.tar.gz
marex-dev-a106db73796d6843626bb64c300bd5beabb34a36.tar.bz2
place: comments and don't ignore lower right corner
git-svn-id: file:///beryl/trunk@1879 d7aaf104-2d23-0410-ae22-9d23157bf5a3
Diffstat (limited to 'beryl-plugins/src/place.c')
-rw-r--r--beryl-plugins/src/place.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/beryl-plugins/src/place.c b/beryl-plugins/src/place.c
index 047a334..820d850 100644
--- a/beryl-plugins/src/place.c
+++ b/beryl-plugins/src/place.c
@@ -590,7 +590,7 @@ placeIntelligent (CompWindow * w, int *x, int *y, GList * windows)
placeCentered(w,x,y);
XRectangle cRect = {*x,*y,wRect.width,wRect.height};
- if (!rectangle_overlaps_some_window(&cRect,windows)) return;
+ if (!rectangle_overlaps_some_window(&cRect,windows)) return; /*If it fits place it in the center */
int xi;
int yi;
@@ -606,22 +606,22 @@ placeIntelligent (CompWindow * w, int *x, int *y, GList * windows)
if (!rectangle_overlaps_some_window (&wRect, windows))
{
- if (!(xi + w->serverWidth > sRect.width)
- || !(yi + w->serverHeight > sRect.height))
- {
+
+ if ( !((wRect.width > sRect.width/2) && ((wRect.width+w->serverX > sRect.width) || (wRect.height+w->serverY > sRect.height)) ) )
*x = xi;
*y = yi;
return;
- }
+
}
}
}
+ /* No fit and big window? Center it, that tends to be what people expect */
if (tries == 0 && wRect.width > ( sRect.width/2 ) )
{
placeCentered(w,x,y);
return;
}
-
+ /* Would the window fit if it was smaller ? */
if(tries < 10 && wRect.width>0 && wRect.height>0) {
tries++;
wRect.width-=wIter;