From a2aad27a78098acda015f48ea0fc0953f3322c4a Mon Sep 17 00:00:00 2001 From: Alex Fiestas Date: Wed, 27 Jul 2011 20:10:11 +0200 Subject: [PATCH] Make sure that not maximized clients are offscreen on xrandr events Added a small check in Client::checkWorkspacePosition which will assure us that no window ("client") is left in a offscreen position. this is more a workaround than a proper fix but is the only thing we can do that will be backportable to the 4.7 branch. --- geometry.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) 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()));