fix: skip popup position clamping on Wayland#640
Conversation
There was a problem hiding this comment.
Sorry @yixinshark, you have reached your weekly rate limit of 500000 diff characters.
Please try again later or upgrade to continue using Sourcery
0062ae5 to
4832a7d
Compare
|
TAG Bot New tag: 6.7.44 |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 18202781743, yixinshark The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
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
4832a7d to
62512cf
Compare
|
/forcemerge |
deepin pr auto review★ 总体评分:100分■ 【总体评价】
■ 【详细分析】
■ 【改进建议代码示例】 --- a/src/private/dpopupwindowhandle.cpp
+++ b/src/private/dpopupwindowhandle.cpp
@@ -206,6 +206,9 @@ void DPopupWindowHandle::adjustPopupPosition()
if (!isEnabled() ||!m_popupWin)
return;
+ // Wayland平台下跳过位置调整,交由合成器处理以避免定位错乱
+ if (DGuiApplicationHelper::testAttribute(DGuiApplicationHelper::IsWaylandPlatform))
+ return;
+
const QSize size = m_popupWin->size();
if (size.width() <= 0 || size.height() <= 0)
return;
@@ -235,7 +238,8 @@ 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: |
|
This pr force merged! (status: unstable) |
Summary
Test plan
Pms: BUG-295233