even more fixes for maximizing/placement with hidden slit/toolbar/etc
This commit is contained in:
parent
2809005ab0
commit
6a36505f8a
2 changed files with 40 additions and 22 deletions
|
@ -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);
|
||||
} 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)) ||
|
||||
|
|
|
@ -572,21 +572,23 @@ void Workspace::placeWindow(OpenboxWindow *win) {
|
|||
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);
|
||||
} 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);
|
||||
|
@ -595,8 +597,15 @@ void Workspace::placeWindow(OpenboxWindow *win) {
|
|||
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)) ||
|
||||
|
|
Loading…
Reference in a new issue