Commit 432787e0 authored by Vlad Zahorodnii's avatar Vlad Zahorodnii

Use Q_ASSERT in XdgShellClient::transientPlacement()

Summary: This simplifies CFG.

Test Plan: Compiles.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D27124
parent 85c09993
......@@ -1632,6 +1632,8 @@ bool XdgShellClient::hasTransientPlacementHint() const
QRect XdgShellClient::transientPlacement(const QRect &bounds) const
{
Q_ASSERT(m_xdgShellPopup);
QRect anchorRect;
Qt::Edges anchorEdge;
Qt::Edges gravity;
......@@ -1660,20 +1662,15 @@ QRect XdgShellClient::transientPlacement(const QRect &bounds) const
return true;
};
if (m_xdgShellPopup) {
anchorRect = m_xdgShellPopup->anchorRect();
anchorEdge = m_xdgShellPopup->anchorEdge();
gravity = m_xdgShellPopup->gravity();
offset = m_xdgShellPopup->anchorOffset();
constraintAdjustments = m_xdgShellPopup->constraintAdjustments();
if (!size.isValid()) {
size = m_xdgShellPopup->initialSize();
}
} else {
Q_UNREACHABLE();
anchorRect = m_xdgShellPopup->anchorRect();
anchorEdge = m_xdgShellPopup->anchorEdge();
gravity = m_xdgShellPopup->gravity();
offset = m_xdgShellPopup->anchorOffset();
constraintAdjustments = m_xdgShellPopup->constraintAdjustments();
if (!size.isValid()) {
size = m_xdgShellPopup->initialSize();
}
//initial position
popupPosition = QRect(popupOffset(anchorRect, anchorEdge, gravity, size) + offset + parentClientPos, size);
......
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