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.
This commit is contained in:
Alex Fiestas 2011-07-27 20:10:11 +02:00
parent 68bba98e5f
commit a2aad27a78

View file

@ -1154,6 +1154,15 @@ void Client::checkWorkspacePosition(const QRect &geo)
newGeom.x() + newGeom.width() - 1)); 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 // Obey size hints. TODO: We really should make sure it stays in the right place
newGeom.setSize(adjustedSize(newGeom.size())); newGeom.setSize(adjustedSize(newGeom.size()));