keep quick maximized w/ size restritions in screen

... bounds
BUG: 348121
REVIEW: 123910
This commit is contained in:
Thomas Lübking 2015-05-26 22:34:31 +02:00
parent c4140d6f4e
commit 1df2d5979f

View file

@ -2317,10 +2317,12 @@ void Client::changeMaximize(bool vertical, bool horizontal, bool adjust)
r.setTopLeft(rules()->checkPosition(r.topLeft()));
r.setSize(adjustedSize(r.size(), SizemodeMax));
if (r.size() != clientArea.size()) { // to avoid off-by-one errors...
if (isElectricBorderMaximizing() && r.width() < clientArea.width())
r.moveLeft(Cursor::pos().x() - r.width()/2);
else
if (isElectricBorderMaximizing() && r.width() < clientArea.width()) {
r.moveLeft(qMax(clientArea.left(), Cursor::pos().x() - r.width()/2));
r.moveRight(qMin(clientArea.right(), r.right()));
} else {
r.moveCenter(clientArea.center());
}
r.moveTopLeft(rules()->checkPosition(r.topLeft()));
}
setGeometry(r, geom_mode);