Conversation
1. Root cause: AvatarSettingsDialog uses Qt.WindowModal modality but dilogLoader.onLoaded never set transientParent, so the window manager cannot locate the parent window to dim 2. Fix: assign transientParent = Window.window before show(), matching the verified pattern in UserExperienceProgramPage.qml 3. Impact: only affects avatar settings dialog open behavior, no change to other dialogs or existing logic Log: Fix avatar settings dialog not dimming the control center window Influence: 1. Test opening avatar settings dialog and verify parent window is dimmed 2. Test closing the dialog and verify parent window returns to normal 3. Verify no regression on other account settings operations fix: 修复头像设置对话框未置灰父窗口的问题 1. 根因:AvatarSettingsDialog 使用 Qt.WindowModal 模态但 dilogLoader 的 onLoaded 回调未设置 transientParent,窗口管理器无法定位父窗口 进行置灰 2. 方案:在 show() 前设置 transientParent = Window.window,参照 UserExperienceProgramPage.qml 已验证模式 3. 影响:仅影响头像设置对话框打开行为,不影响其他对话框或已有逻辑 Log: 修复头像设置对话框未置灰控制中心主窗口的问题 Influence: 1. 测试打开头像设置对话框,验证父窗口被置灰 2. 测试关闭对话框,验证父窗口恢复正常 3. 验证账户设置其他操作无回归 PMS: BUG-305139
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: mhduiy 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 |
Reviewer's guide (collapsed on small PRs)Reviewer's GuideUpdates the avatar settings dialog loading path to set its transient parent before showing, enabling correct window-modal dimming while preserving a null-safe fallback. Sequence diagram for modal avatar settings dialog loadingsequenceDiagram
participant User
participant AccountSettings
participant AvatarSettingsDialog
participant MainWindow
User->>AccountSettings: Click avatar
AccountSettings->>AvatarSettingsDialog: onLoaded()
AccountSettings->>MainWindow: Window.window
alt parentWin exists
AccountSettings->>AvatarSettingsDialog: transientParent = parentWin
end
AccountSettings->>AvatarSettingsDialog: show()
AvatarSettingsDialog-->>MainWindow: Apply WindowModal dimming
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
deepin pr auto review🤖 AI 代码审查报告📊 总体评价
🔍 详细分析1. 语法逻辑 ✅评价: 优秀 ✅ 通过 潜在问题: 建议: 代码语法正确,逻辑清晰。var parentWin = Window.window 获取窗口引用,if (parentWin) 空值守卫确保 Window.window 为 null 时退化为原始 show() 行为,边界处理完善。 2. 代码质量 ✅评价: 优秀 ✅ 通过 潜在问题: 建议: 代码结构清晰,变更最小化(仅新增 4 行),未修改或删除已有逻辑。变量命名 parentWin 清晰达意,遵循同仓库 UserExperienceProgramPage.qml 已验证模式,无重复代码,无残留调试代码。 3. 代码性能 ✅评价: 优秀 ✅ 通过 潜在问题: 建议: 性能良好,仅设置 transientParent 属性后调用 show(),无不必要的计算、循环或系统调用,资源使用合理。 4. 代码安全 🔒评价: 优秀 ✅ 通过
安全漏洞详情: 建议: 存在0个安全漏洞。代码不涉及用户输入处理、网络操作、文件操作或命令执行,无硬编码密钥或敏感信息泄露风险。 💡 改进建议代码示例// 本次变更已符合最佳实践,无需额外改进
// onLoaded: function () {
// var parentWin = Window.window
// if (parentWin) {
// dilogLoader.item.transientParent = parentWin
// }
// dilogLoader.item.show()
// }本报告由 AI 代码审查工具自动生成 |
|
修改会引入其他问题,不适合这样修改,暂时关闭 |
Root Cause
AvatarSettingsDialoginAccountSettings.qmlusesQt.WindowModalmodality, but thedilogLoader.onLoadedcallback never settransientParentbefore calling.show(). WithouttransientParent, the window manager cannot locate the parent window to apply modal dimming, so the control center main window is not grayed out when the avatar settings dialog opens.Key evidence: The same repo's
UserExperienceProgramPage.qml:43-49already has the correct pattern — settingtransientParent = Window.windowbefore.show(), and that dialog dims correctly.Fix
Add
transientParent = Window.windowassignment before.show()in thedilogLoader.onLoadedcallback, matching the verified pattern inUserExperienceProgramPage.qml. UsesWindow.window(deterministic reference) instead ofQt.application.activeWindowto avoid the layering issue seen in bug-352609.Change Safety Assessment
if (parentWin)ensures graceful fallback to original.show()behavior whenWindow.windowis nulldilogLoaderis local toAccountSettings.qml, no cross-file referencesBusiness Impact
UserExperienceProgramPage.qmlVerification
根因分析
AccountSettings.qml中的AvatarSettingsDialog使用Qt.WindowModal模态,但dilogLoader.onLoaded回调在调用.show()前未设置transientParent。缺少transientParent时,窗口管理器无法定位父窗口进行模态置灰,导致打开头像设置对话框时控制中心主窗口不置灰。关键证据:同仓库
UserExperienceProgramPage.qml:43-49已有正确模式——在.show()前设置transientParent = Window.window,该对话框置灰正常。修复方案
在
dilogLoader.onLoaded回调中于.show()前添加transientParent = Window.window赋值,参照UserExperienceProgramPage.qml已验证模式。使用Window.window(确定性引用)而非Qt.application.activeWindow,避免 bug-352609 的层级问题。改动安全评估
if (parentWin)确保Window.window为 null 时退化为原始.show()行为dilogLoader为AccountSettings.qml内部使用,无跨文件引用业务影响范围
UserExperienceProgramPage.qml已有相同模式验证验证建议
PMS: BUG-305139
Summary by Sourcery
Bug Fixes: