fix quick unmaximization position

CCBUG: 298646
REVIEW: 104702
This commit is contained in:
Thomas Lübking 2012-04-23 12:13:31 +02:00
parent 44b2b1e493
commit ae769906de

View file

@ -2258,8 +2258,8 @@ void Client::changeMaximize(bool vertical, bool horizontal, bool adjust)
QSize adjSize = adjustedSize(clientArea.size(), SizemodeMax); QSize adjSize = adjustedSize(clientArea.size(), SizemodeMax);
QRect r = QRect(clientArea.topLeft(), adjSize); QRect r = QRect(clientArea.topLeft(), adjSize);
if (r.size() != clientArea.size()) { // to avoid off-by-one errors... if (r.size() != clientArea.size()) { // to avoid off-by-one errors...
if (isElectricBorderMaximizing()) if (isElectricBorderMaximizing() && r.width() < clientArea.width())
r.moveLeft(qMax(clientArea.x(), QCursor::pos().x() - r.width()/2)); r.moveLeft(QCursor::pos().x() - r.width()/2);
else else
r.moveCenter(clientArea.center()); r.moveCenter(clientArea.center());
} }