summaryrefslogtreecommitdiff
path: root/src/Window.cc
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2002-04-22 23:00:57 +0000
committerDana Jansens <danakj@orodu.net>2002-04-22 23:00:57 +0000
commit6a36505f8aa312ee2ccf0f173bc0fc6659664418 (patch)
tree389974a61bf157e98c1fe4674896f26039bdc3c4 /src/Window.cc
parent2809005ab0ab761a831f4353f2ff190a62d92794 (diff)
even more fixes for maximizing/placement with hidden slit/toolbar/etc
Diffstat (limited to 'src/Window.cc')
-rw-r--r--src/Window.cc31
1 files changed, 20 insertions, 11 deletions
diff --git a/src/Window.cc b/src/Window.cc
index 6d9d8859..f768f6c1 100644
--- a/src/Window.cc
+++ b/src/Window.cc
@@ -1564,21 +1564,23 @@ void OpenboxWindow::maximize(unsigned int button) {
slit->placement() == Slit::TopRight)) ||
slit->placement() == Slit::TopCenter) {
// exclude top
- if (tbartop)
- space.setH(space.h() - slit_y);
- else
+ if (tbartop && slit_y + slit->area().h() < tbarh) {
+ space.setY(space.y() + tbarh);
space.setH(space.h() - tbarh);
- space.setY(space.y() + slit_y + slit->area().h() +
- screen->getBorderWidth() * 2);
- space.setH(space.h() - (slit_y + slit->area().h() +
- screen->getBorderWidth() * 2));
+ } else {
+ space.setY(space.y() + (slit_y + slit->area().h() +
+ screen->getBorderWidth() * 2));
+ space.setH(space.h() - (slit_y + slit->area().h() +
+ screen->getBorderWidth() * 2));
+ if (!tbartop)
+ space.setH(space.h() - tbarh);
+ }
} else if ((slit->direction() == Slit::Vertical &&
(slit->placement() == Slit::TopRight ||
slit->placement() == Slit::BottomRight)) ||
slit->placement() == Slit::CenterRight) {
// exclude right
- space.setW(space.w() - (screen->size().w() - slit_x +
- screen->getBorderWidth() * 2));
+ space.setW(space.w() - (screen->size().w() - slit_x));
if (tbartop)
space.setY(space.y() + tbarh);
space.setH(space.h() - tbarh);
@@ -1587,8 +1589,15 @@ void OpenboxWindow::maximize(unsigned int button) {
slit->placement() == Slit::BottomRight)) ||
slit->placement() == Slit::BottomCenter) {
// exclude bottom
- space.setH(space.h() - ((screen->size().h() - slit_y) > tbarh ?
- screen->size().h() - slit_y : tbarh));
+ if (!tbartop && (screen->size().h() - slit_y) < tbarh) {
+ space.setH(space.h() - tbarh);
+ } else {
+ space.setH(space.h() - (screen->size().h() - slit_y));
+ if (tbartop) {
+ space.setY(space.y() + tbarh);
+ space.setH(space.h() - tbarh);
+ }
+ }
} else {// if ((slit->direction() == Slit::Vertical &&
// (slit->placement() == Slit::TopLeft ||
// slit->placement() == Slit::BottomLeft)) ||