Commit 85c09993 authored by Vlad Zahorodnii's avatar Vlad Zahorodnii

Use QRect::moveRight() and QRect::moveBottom() in XdgShellClient::transientPlacement()

Summary: It's more intuitive.

Test Plan: Relevant tests pass.

Reviewers: #kwin

Subscribers: davidedmundson, broulik, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D27050
parent 98634e01
......@@ -1707,8 +1707,7 @@ QRect XdgShellClient::transientPlacement(const QRect &bounds) const
popupPosition.moveLeft(bounds.x());
}
if (!inBounds(popupPosition, Qt::RightEdge)) {
// moveRight suffers from the classic QRect off by one issue
popupPosition.moveLeft(bounds.x() + bounds.width() - size.width());
popupPosition.moveRight(bounds.right());
}
}
if (constraintAdjustments & PositionerConstraint::ResizeX) {
......@@ -1750,7 +1749,7 @@ QRect XdgShellClient::transientPlacement(const QRect &bounds) const
popupPosition.moveTop(bounds.y());
}
if (!inBounds(popupPosition, Qt::BottomEdge)) {
popupPosition.moveTop(bounds.y() + bounds.height() - size.height());
popupPosition.moveBottom(bounds.bottom());
}
}
if (constraintAdjustments & PositionerConstraint::ResizeY) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment