keep quick maximized w/ size restritions in screen
... bounds BUG: 348121 REVIEW: 123910
This commit is contained in:
parent
c4140d6f4e
commit
1df2d5979f
1 changed files with 5 additions and 3 deletions
|
@ -2317,10 +2317,12 @@ void Client::changeMaximize(bool vertical, bool horizontal, bool adjust)
|
||||||
r.setTopLeft(rules()->checkPosition(r.topLeft()));
|
r.setTopLeft(rules()->checkPosition(r.topLeft()));
|
||||||
r.setSize(adjustedSize(r.size(), SizemodeMax));
|
r.setSize(adjustedSize(r.size(), SizemodeMax));
|
||||||
if (r.size() != clientArea.size()) { // to avoid off-by-one errors...
|
if (r.size() != clientArea.size()) { // to avoid off-by-one errors...
|
||||||
if (isElectricBorderMaximizing() && r.width() < clientArea.width())
|
if (isElectricBorderMaximizing() && r.width() < clientArea.width()) {
|
||||||
r.moveLeft(Cursor::pos().x() - r.width()/2);
|
r.moveLeft(qMax(clientArea.left(), Cursor::pos().x() - r.width()/2));
|
||||||
else
|
r.moveRight(qMin(clientArea.right(), r.right()));
|
||||||
|
} else {
|
||||||
r.moveCenter(clientArea.center());
|
r.moveCenter(clientArea.center());
|
||||||
|
}
|
||||||
r.moveTopLeft(rules()->checkPosition(r.topLeft()));
|
r.moveTopLeft(rules()->checkPosition(r.topLeft()));
|
||||||
}
|
}
|
||||||
setGeometry(r, geom_mode);
|
setGeometry(r, geom_mode);
|
||||||
|
|
Loading…
Reference in a new issue