|
|
|
|
@ -1157,15 +1157,7 @@ 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)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
checkOffscreenPosition(newGeom, screenArea); |
|
|
|
|
// Obey size hints. TODO: We really should make sure it stays in the right place
|
|
|
|
|
newGeom.setSize(adjustedSize(newGeom.size())); |
|
|
|
|
|
|
|
|
|
@ -1174,6 +1166,18 @@ void Client::checkWorkspacePosition(const QRect &geo) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void Client::checkOffscreenPosition(QRect& geom, const QRect& screenArea) |
|
|
|
|
{ |
|
|
|
|
if (geom.x() > screenArea.right()) { |
|
|
|
|
int screenWidth = screenArea.width(); |
|
|
|
|
geom.moveLeft(screenWidth - (screenWidth / 4)); |
|
|
|
|
} |
|
|
|
|
if (geom.y() > screenArea.bottom()) { |
|
|
|
|
int screenHeight = screenArea.height(); |
|
|
|
|
geom.moveBottom(screenHeight - (screenHeight / 4)); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Try to be smart about keeping the clients visible.
|
|
|
|
|
// If the client was fully inside the workspace before, try to keep
|
|
|
|
|
// it still inside the workarea, possibly moving it or making it smaller if possible,
|
|
|
|
|
|