- }
-
- case BScreen::ColSmartPlacement: {
- test_x = (screen.getRowPlacementDirection() == BScreen::LeftRight) ?
- start_pos : screen.getWidth() - win_w - start_pos;
-
- while (!placed &&
- ((screen.getRowPlacementDirection() == BScreen::RightLeft) ?
- test_x > 0 : test_x + win_w < (signed) screen.getWidth())) {
- test_y = (screen.getColPlacementDirection() == BScreen::TopBottom) ?
- start_pos : screen.getHeight() - win_h - start_pos;
-
- while (!placed &&
- ((screen.getColPlacementDirection() == BScreen::BottomTop) ?
- test_y > 0 : test_y + win_h < (signed) screen.getHeight())) {
- placed = True;
-
- it.reset();
- for (OpenboxWindow *curr = it.current(); placed && curr;
- it++, curr = it.current()) {
- if (curr->isMaximizedFull()) // fully maximized, ignore it
- continue;
- int curr_w = curr->getWidth() + (screen.getBorderWidth() * 4);
- int curr_h =
- ((curr->isShaded()) ? curr->getTitleHeight() : curr->getHeight()) +
- (screen.getBorderWidth() * 4);
-
- if (curr->getXFrame() < test_x + win_w &&
- curr->getXFrame() + curr_w > test_x &&
- curr->getYFrame() < test_y + win_h &&
- curr->getYFrame() + curr_h > test_y) {
- placed = False;
- }
- }
-
- if (placed &&
- (toolbar_x < test_x + win_w &&
- toolbar_x + toolbar_w > test_x &&
- toolbar_y < test_y + win_h &&
- toolbar_y + toolbar_h > test_y)
-#ifdef SLIT
- ||
- (slit_x < test_x + win_w &&
- slit_x + slit_w > test_x &&
- slit_y < test_y + win_h &&
- slit_y + slit_h > test_y)
-#endif // SLIT
- )
- placed = False;
-
- if (placed) {
- place_x = test_x;
- place_y = test_y;
-
- break;
- }
-
- test_y += (change_y * delta_y);
- }
-
- test_x += (change_x * delta_x);
- }
-