XdgPopupWindow: Allow position to be set by Plasma

This lets Plasma itself control the position of popup windows such as
Plasma tooltips. transientPlacement() now returns the position set by Plasma
if available.

BUG: 463272
This commit is contained in:
Bharadwaj Raju 2023-05-23 13:41:43 +00:00
parent 2aba3deca4
commit 539b6bb6ac

View file

@ -1644,9 +1644,12 @@ bool XdgPopupWindow::hasTransientPlacementHint() const
QRectF XdgPopupWindow::transientPlacement(const QRectF &bounds) const
{
const XdgPositioner positioner = m_shellSurface->positioner();
const QSize desiredSize = positioner.size();
if (m_plasmaShellSurface && m_plasmaShellSurface->isPositionSet()) {
return QRectF(m_plasmaShellSurface->position(), desiredSize);
}
const QPointF parentPosition = transientFor()->framePosToClientPos(transientFor()->pos());
// returns if a target is within the supplied bounds, optional edges argument states which side to check