keep quick maximized w/ size restritions in screen

... bounds
BUG: 348121
REVIEW: 123910
icc-effect-5.14.5
Thomas Lübking 2015-05-26 22:34:31 +02:00
parent c4140d6f4e
commit 1df2d5979f
1 changed files with 5 additions and 3 deletions

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);