From 539b6bb6ac3a58049b96106de55004806c639821 Mon Sep 17 00:00:00 2001 From: Bharadwaj Raju Date: Tue, 23 May 2023 13:41:43 +0000 Subject: [PATCH] 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 --- src/xdgshellwindow.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/xdgshellwindow.cpp b/src/xdgshellwindow.cpp index f3a552d36a..918599c90c 100644 --- a/src/xdgshellwindow.cpp +++ b/src/xdgshellwindow.cpp @@ -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