From 62512cf48412a060448c3d7bb4e56f46ed375365 Mon Sep 17 00:00:00 2001 From: zhaoyingzhen Date: Wed, 17 Jun 2026 10:10:09 +0800 Subject: [PATCH] fix: skip popup position clamping on Wayland MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Wayland QQuickPopupWindow positions are relative to the parent surface instead of global screen coordinates. Skip the global screen-bound clamping for popup windows on Wayland so Qt and the compositor keep the intended popup placement. Wayland 下 QQuickPopupWindow 的位置是相对父 surface 的,不是屏幕全局坐标。 在 Wayland 下跳过 popup 窗口的全局屏幕边界裁剪,让 Qt 和合成器保留原本的弹出位置。 X11下需要整个屏幕的尺寸去计算边缘溢出屏幕。 Log: skip popup position clamping on Wayland Pms: BUG-295233 Change-Id: I5cdaea0094fc124609e8f016da8d846cb4106929 --- src/private/dpopupwindowhandle.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/private/dpopupwindowhandle.cpp b/src/private/dpopupwindowhandle.cpp index 647269a4..f1af7247 100644 --- a/src/private/dpopupwindowhandle.cpp +++ b/src/private/dpopupwindowhandle.cpp @@ -206,6 +206,9 @@ void DPopupWindowHandle::adjustPopupPosition() if (!isEnabled() ||!m_popupWin) return; + if (DGuiApplicationHelper::testAttribute(DGuiApplicationHelper::IsWaylandPlatform)) + return; + const QSize size = m_popupWin->size(); if (size.width() <= 0 || size.height() <= 0) return; @@ -235,7 +238,7 @@ void DPopupWindowHandle::adjustPopupPosition() if (!screen) return; - const QRectF bounds(screen->availableGeometry()); + const QRectF bounds(screen->geometry()); QRectF rect(QPointF(m_popupWin->position()), QSizeF(size)); // Horizontal flip for submenus: