summaryrefslogtreecommitdiff
path: root/src/Workspace.cc
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2002-04-21 02:02:27 +0000
committerDana Jansens <danakj@orodu.net>2002-04-21 02:02:27 +0000
commit32951060f693424bd173888e16382a02949c450e (patch)
tree9d510b2f2fc6a373c1742ea65b80286dc004f121 /src/Workspace.cc
parentec028e395f5b88611759c88d1af39bcd708c2910 (diff)
bestfit placement now honors the left->right and top->bottom options for window placement.
fix for the placement config menu.
Diffstat (limited to 'src/Workspace.cc')
-rw-r--r--src/Workspace.cc11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/Workspace.cc b/src/Workspace.cc
index 5f8817cb..70b043c0 100644
--- a/src/Workspace.cc
+++ b/src/Workspace.cc
@@ -396,9 +396,14 @@ Point *Workspace::bestFitPlacement(const Size &win_size, const Rect &space)
best = siter;
}
- if (best != NULL)
- return new Point(best->origin());
- else
+ if (best != NULL) {
+ Point *pt = new Point(best->origin());
+ if (screen.colPlacementDirection() != BScreen::TopBottom)
+ pt->setY(pt->y() + (best->h() - win_size.h()));
+ if (screen.rowPlacementDirection() != BScreen::LeftRight)
+ pt->setX(pt->x() + (best->w() - win_size.w()));
+ return pt;
+ } else
return NULL; //fall back to cascade
}