for (; wit != end; ++wit) {
const BlackboxWindow* const curr = *wit;
- if (curr->isShaded() && screen->getPlaceIgnoreShaded()) continue;
- if (curr->isMaximizedFull() && screen->getPlaceIgnoreMaximized()) continue;
+ // watch for shaded windows and full-maxed windows
+ if (curr->isShaded()) {
+ if (screen->getPlaceIgnoreShaded()) continue;
+ } else if (curr->isMaximizedFull()) {
+ if (screen->getPlaceIgnoreMaximized()) continue;
+ }
tmp.setRect(curr->frameRect().x(), curr->frameRect().y(),
curr->frameRect().width() + screen->getBorderWidth(),
cascadePlacement(new_win, (win->getTitleHeight() +
screen->getBorderWidth() * 2));
- // make sure the placement was valid
- assert(screen->availableArea().contains(new_win));
+ if (new_win.right() > screen->availableArea().right())
+ new_win.setX(screen->availableArea().left());
+ if (new_win.bottom() > screen->availableArea().bottom())
+ new_win.setY(screen->availableArea().top());
win->configure(new_win.x(), new_win.y(), new_win.width(), new_win.height());
}