- cascade_x += win->getTitleHeight();
- cascade_y += win->getTitleHeight();
-
- return new Point(cascade_x, cascade_y);
-}
-
-
-void Workspace::placeWindow(OpenboxWindow *win) {
- ASSERT(win != NULL);
-
- // the following code is temporary and will be taken care of by Screen in the
- // future (with the NETWM 'strut')
- Rect space(0, 0, screen.size().w(), screen.size().h());
-
-#ifdef SLIT
- Slit *slit = screen.getSlit();
- int remove; // 0 - top/2 - right/2 - bottom/3 - left
- if ((slit->direction() == Slit::Horizontal &&
- (slit->placement() == Slit::TopLeft ||
- slit->placement() == Slit::TopRight)) ||
- slit->placement() == Slit::TopCenter)
- remove = 0;
- else if ((slit->direction() == Slit::Vertical &&
- (slit->placement() == Slit::TopRight ||
- slit->placement() == Slit::BottomRight)) ||
- slit->placement() == Slit::CenterRight)
- remove = 1;
- else if ((slit->direction() == Slit::Horizontal &&
- (slit->placement() == Slit::BottomLeft ||
- slit->placement() == Slit::BottomRight)) ||
- slit->placement() == Slit::TopCenter)
- remove = 2;
- else// if ((slit->direction() == Slit::Vertical &&
- // (slit->placement() == Slit::TopLeft ||
- // slit->placement() == Slit::BottomLeft)) ||
- // slit->placement() == Slit::CenterLeft)
- remove = 3;
- switch (remove) {
- case 0: // top
- space.setY(slit->area().h() + screen.getBorderWidth() * 2);
- break;
- case 1: // right
- space.setW(screen.size().w() -
- (slit->area().w() + screen.getBorderWidth() * 2));
- break;
- case 2: // bottom
- space.setH(screen.size().h() -
- (slit->area().h() + screen.getBorderWidth() * 2));
- break;
- case 3: // left
- space.setX(slit->area().w() + screen.getBorderWidth() * 2);
- break;
- }
-#endif
-
- Toolbar *toolbar = screen.getToolbar();
- int tbarh = screen.hideToolbar() ? 0 :
- toolbar->getExposedHeight() + screen.getBorderWidth() * 2;
- switch (toolbar->placement()) {
- case Toolbar::TopLeft:
- case Toolbar::TopCenter:
- case Toolbar::TopRight:
- if (tbarh > space.y())
- space.setY(toolbar->getExposedHeight());
- break;
- case Toolbar::BottomLeft:
- case Toolbar::BottomCenter:
- case Toolbar::BottomRight:
- if (screen.size().h() - tbarh < space.h())
- space.setH(screen.size().h() - tbarh);
- break;
- default:
- ASSERT(false); // unhandled placement