fix(dialog): remove KWin blur from DialogWindow to fix dark theme issue#628
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThis PR removes the default KWin blur behavior from DialogWindow and simplifies its background color handling to always be transparent, ensuring dialogs respect the standard DTK palette and fixing dark-theme bleed-through issues in cases like dde-launchpad. Flow diagram for DialogWindow color and blur configuration changeflowchart TD
A[DialogWindow initialization] --> B[Previous: D.DWindow.enableBlurWindow = true]
B --> C[Previous: color = transparent if enableBlurWindow]
C --> D[Else: color = active/inactive DTK window]
A --> E[Now: D.DWindow.enableBlurWindow removed]
E --> F[Now: color = transparent]
F --> G[KWin blur not applied; standard DTK palette respected behind dialog]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- The description says dialogs will 'use standard DTK palette', but the change makes
coloralways"transparent", which no longer usesDTK.palette.window; consider either restoring palette-based coloring when blur is off or updating the description to match the behavior.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The description says dialogs will 'use standard DTK palette', but the change makes `color` always `"transparent"`, which no longer uses `DTK.palette.window`; consider either restoring palette-based coloring when blur is off or updating the description to match the behavior.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
50834d3 to
3d37e45
Compare
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 18202781743, mhduiy, robertkill 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 |
1. Remove enableBlurWindow: true default from DialogWindow.qml 2. Set color to transparent directly instead of conditional on enableBlurWindow Influence: 1. All DialogWindow instances will no longer use KWin blur 2. Dialog windows will use standard DTK palette without blur side effects 3. Applications forcing dark theme will not affect dialog appearance fix: 从 DialogWindow 移除 KWin blur 以修复深色主题问题 1. 从 DialogWindow.qml 中移除 enableBlurWindow: true 默认值 2. 将 color 直接设为 transparent,不再依赖 enableBlurWindow 条件判断 Influence: 1. 测试所有使用 DialogWindow 的对话框在浅色/深色主题下的显示 2. 验证 dde-launchpad 卸载确认对话框在浅色系统主题下不再显示深色 3. 检查其他 DTK 应用(如关于对话框)的 blur 效果是否正常 4. 在不同屏幕分辨率和缩放比例下进行测试 PMS: BUG-359629
3d37e45 to
21d979f
Compare
deepin pr auto review你好!我是CodeGeeX,你的智能编程助手。我已仔细审查了你提供的 Git Diff 输入。本次修改主要针对 QML 中的 以下是针对语法逻辑、代码质量、代码性能和代码安全四个维度的详细审查与改进意见: 1. 语法逻辑
2. 代码质量
3. 代码性能
4. 代码安全
💡 改进建议与代码示例为了提升代码的健壮性和可维护性,建议:
改进后的代码示例: Window {
// ... 其他属性保持不变 ...
D.DWindow.enableSystemResize: false
D.DWindow.motifFunctions: D.WindowManagerHelper.FUNC_ALL & ~D.WindowManagerHelper.FUNC_RESIZE
D.DWindow.wmWindowTypes: D.WindowManagerHelper.DialogType
// 移除了 enableBlurWindow: true
flags: Qt.Dialog | Qt.WindowCloseButtonHint | Qt.MSWindowsFixedSizeDialogHint
D.ColorSelector.family: D.Palette.CrystalColor
// 改进点 1:使用条件表达式提供回退色,避免在某些不支持透明度的 Linux 窗口管理器上出现黑块
// 如果确认当前运行环境完全支持透明,可直接使用 "transparent"
color: D.DWindow.enableBlurWindow ? "transparent" : D.DTK.palette.window
// 改进点 2:如果必须全透明,确保整个窗口区域可以拦截鼠标事件,防止点击穿透
// 可以添加一个 MouseArea 作为底层拦截
MouseArea {
anchors.fill: parent
onClicked: {} // 拦截点击,不做处理,防止穿透
}
height: content.height
width: content.width
// 改进点 3:确保 content 能够完全填充窗口并提供视觉边界
// ...
}总结:本次修改的核心逻辑是合理的,主要目的是优化性能和简化渲染逻辑。但需要特别注意跨平台透明窗口的渲染兼容性以及鼠标事件穿透的问题。如果该应用只在特定桌面环境(如 DDE,看代码前缀似乎是 Deepin 相关)下运行,透明度支持通常较好,但仍建议做好防御性编程。 |
问题
DialogWindow 默认启用 KWin blur (
enableBlurWindow: true)。当应用强制深色主题时(如 dde-launchpad 全屏模式),blur 会透过对话框显示背后的深色背景,导致对话框在浅色系统主题下也显示为深色。修复
enableBlurWindow: true默认值color直接设为transparent,不再依赖enableBlurWindow条件判断影响
所有使用 DialogWindow 的对话框将不再启用 KWin blur,使用标准 DTK 调色板。
测试
已在调试机上验证,dde-launchpad 卸载确认对话框恢复正常。
Bug: https://pms.uniontech.com/bug-view-359629.html
Summary by Sourcery
Bug Fixes: