fix: fix Layer Shell popup positioning race condition#1025
Draft
deepin-wm wants to merge 1 commit into
Draft
Conversation
1. Add parent geometry validity check in handleLayerShellPopup() with hasInitializeContainer and parentGeo.isEmpty() guards 2. Add hasInitializeContainer() check for Layer type parent in arrangePopupSurface() 3. Connect parent Layer Surface signals (normalGeometryChanged, hasInitializeContainerChanged) in addSurface() to trigger popup repositioning using QPointer for safety 4. Use QMetaObject::Connection with m_parentLayerConnections hash to manage signal connection lifecycle 5. Disconnect parent surface signals in removeSurface() for proper cleanup when popup is removed 6. Add #include <QPointer> explicit declaration Log: Fixed UOS ID login window intermittently displaying abnormally and becoming unclickable Influence: 1. Test UOS ID login window opens and displays correctly every time 2. Test Layer Shell popup positioning after parent surface resize 3. Test popup cleanup when parent surface is destroyed 4. Test other Layer Shell popups (menus, tooltips) still work fix: 修复Layer Shell弹窗定位时序竞态问题 1. 在handleLayerShellPopup()中增加父窗口几何有效性检查, 使用hasInitializeContainer和parentGeo.isEmpty()守卫 2. 在arrangePopupSurface()中对Layer类型父窗口增加 hasInitializeContainer()检查 3. 在addSurface()中连接父Layer Surface信号 (normalGeometryChanged, hasInitializeContainerChanged) 触发弹窗重新定位,使用QPointer保证安全 4. 使用QMetaObject::Connection配合m_parentLayerConnections 哈希表管理信号连接生命周期 5. 在removeSurface()中断开父表面信号连接,确保弹窗移除时 正确清理 6. 添加#include <QPointer>显式声明 Log: 修复UOS ID登录窗口概率性显示异常不可点击的问题 Influence: 1. 测试UOS ID登录窗口每次打开均正常显示 2. 测试父表面调整大小后Layer Shell弹窗定位正确 3. 测试父表面销毁时弹窗正确清理 4. 测试其他Layer Shell弹窗(菜单、工具提示)正常工作
There was a problem hiding this comment.
Sorry @deepin-wm, you have reached your weekly rate limit of 500000 diff characters.
Please try again later or upgrade to continue using Sourcery
|
Skipping CI for Draft Pull Request. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: deepin-wm 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题描述
UOS ID 登录窗口概率性显示异常,不可点击。根本原因是 Layer Shell 弹窗定位时存在时序竞态:当弹窗创建时,其父 Layer Surface 的几何信息可能尚未完成初始化,导致弹窗定位到错误位置。
修改内容
handleLayerShellPopup()— 增加父窗口几何有效性检查(hasInitializeContainer 和 parentGeo.isEmpty()),未通过则跳过定位等待重新触发arrangePopupSurface()— 对 Layer 类型父窗口增加 hasInitializeContainer() 检查addSurface()— 连接父 Layer Surface 的 normalGeometryChanged 和 hasInitializeContainerChanged 信号触发弹窗重新定位,使用 QPointer 保证安全,使用 QMetaObject::Connection + m_parentLayerConnections 哈希表管理连接生命周期removeSurface()— popup 移除时精确断开父表面到 Output 的信号连接修改文件
src/output/output.cppsrc/output/output.h测试建议