- test_y += (change_y * delta_y);
- }
- return new Point(place_x, place_y);
-}
-
-void Workspace::placeWindow(OpenboxWindow *win) {
- ASSERT(win != NULL);
-
- Bool placed = False;
-
- const int win_w = win->size().w() + (screen.getBorderWidth() * 4),
- win_h = win->size().h() + (screen.getBorderWidth() * 4),
-#ifdef SLIT
- slit_x = screen.getSlit()->area().x() - screen.getBorderWidth(),
- slit_y = screen.getSlit()->area().y() - screen.getBorderWidth(),
- slit_w = screen.getSlit()->area().w() +
- (screen.getBorderWidth() * 4),
- slit_h = screen.getSlit()->area().h() +
- (screen.getBorderWidth() * 4),
-#endif // SLIT
- toolbar_x = screen.getToolbar()->getX() - screen.getBorderWidth(),
- toolbar_y = screen.getToolbar()->getY() - screen.getBorderWidth(),
- toolbar_w = screen.getToolbar()->getWidth() +
- (screen.getBorderWidth() * 4),
- toolbar_h = screen.getToolbar()->getHeight() +
- (screen.getBorderWidth() * 4),
- start_pos = 0,
- change_y =
- ((screen.getColPlacementDirection() == BScreen::TopBottom) ? 1 : -1),
- change_x =
- ((screen.getRowPlacementDirection() == BScreen::LeftRight) ? 1 : -1),
- delta_x = 8, delta_y = 8;
-
- int test_x, test_y, place_x = 0, place_y = 0;
- LinkedListIterator<OpenboxWindow> it(windowList);
-
- Rect space(0, 0,
- screen.size().w(),
- screen.size().h()
- );
- Size window_size(win_w, win_h);
-
- switch (screen.getPlacementPolicy()) {
- case BScreen::BestFitPlacement: {
- Point *spot = bestFitPlacement(window_size, space);
- if (spot != NULL) {
- place_x=spot->x();
- place_y=spot->y();
- delete spot;
- placed=true;
- }else
- placed=false;
-
- break;
+ tmp.setRect(curr->frameRect().x(), curr->frameRect().y(),
+ curr->frameRect().width() + screen->getBorderWidth(),
+ curr->frameRect().height() + screen->getBorderWidth());
+
+ spaces = calcSpace(tmp, spaces);