fix: 修复4K 225%缩放下切换深色模式时插件面板图标偶现黑色(DDE-225) - #505
MyLeeJiEun wants to merge 2 commits into
Conversation
P0: Defer DGuiApplicationHelper::setPaletteType() call in WidgetPlugin::onDockColorThemeChanged using QTimer::singleShot(0), allowing theme_changed events (icon theme name update) to be processed first in the same batch of Wayland events. P1: In CommonIconButton::setIcon(), when QIcon::fromTheme() returns null, try fallback -> default icon -> keep old icon (don't clear). In refreshIcon(), if icon is still null after setState(), schedule a 50ms delayed retry to handle icon theme not yet loaded. Fixes intermittent black icons when switching dark mode on 4K/225%.
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: MyLeeJiEun 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通过将主题切换调色板更新异步化,并在图标主题资源尚未加载完成时保留有效图标、执行有限次延迟刷新重试,降低高 DPI 分数缩放场景下主题切换引发的图标黑色或错误渲染问题。 Sequence diagram for asynchronous theme change and icon refreshsequenceDiagram
participant Dock as Dock
participant WidgetPlugin as WidgetPlugin
participant Palette as DGuiApplicationHelper
participant IconButton as CommonIconButton
participant Theme as IconTheme
Dock->>WidgetPlugin: onDockColorThemeChanged(type)
WidgetPlugin-->>Palette: setPaletteType(type) via QTimer::singleShot(0)
Palette-->>IconButton: Theme change notification
IconButton->>IconButton: refreshIcon()
IconButton->>Theme: QIcon::fromTheme(icon)
alt icon resource unavailable
IconButton->>IconButton: QTimer::singleShot(50, refreshIcon)
IconButton->>Theme: QIcon::fromTheme(icon)
else icon resource available
IconButton->>IconButton: setIcon(state)
IconButton->>IconButton: update()
end
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
Hi @MyLeeJiEun. Thanks for your PR. I'm waiting for a linuxdeepin member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
|
TAG Bot New tag: 2.0.40 |
|
TAG Bot New tag: 2.0.41 |
修复说明
4K 屏幕、225% 缩放下切换深色模式时,插件面板中图标偶现未切换成功、显示为黑色。
根因
主题切换时三路 Wayland 事件非原子化发送,触发多次重绘竞态;高 DPI 分数缩放下图标渲染时序问题导致图标偶现黑色。
修改内容
关联
Summary by Sourcery
确保主题切换通知与插件图标刷新协调执行,避免竞态导致图标渲染异常。
Bug Fixes:
Enhancements: