diff --git a/geometry.cpp b/geometry.cpp index 04c7b9d567..a357162b15 100644 --- a/geometry.cpp +++ b/geometry.cpp @@ -1154,6 +1154,15 @@ void Client::checkWorkspacePosition(const QRect &geo) newGeom.x() + newGeom.width() - 1)); } + if (newGeom.x() > screenArea.right()) { + int screenWidth = screenArea.width(); + newGeom.moveLeft(screenWidth - (screenWidth / 4)); + } + if (newGeom.y() > screenArea.bottom()) { + int screenHeight = screenArea.height(); + newGeom.moveBottom(screenHeight - (screenHeight / 4)); + } + // Obey size hints. TODO: We really should make sure it stays in the right place newGeom.setSize(adjustedSize(newGeom.size()));