Skip to content

fix: 修复4K 225%缩放下切换深色模式时插件面板图标偶现黑色(DDE-225) - #1723

Draft
MyLeeJiEun wants to merge 2 commits into
linuxdeepin:masterfrom
MyLeeJiEun:fix/dde-225-icon-theme-switch
Draft

MyLeeJiEun wants to merge 2 commits into
linuxdeepin:masterfrom
MyLeeJiEun:fix/dde-225-icon-theme-switch

Conversation

@MyLeeJiEun

@MyLeeJiEun MyLeeJiEun commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

修复说明

4K 屏幕、225% 缩放下切换深色模式时,插件面板中图标偶现未切换成功、显示为黑色。

根因

主题切换时三路 Wayland 事件非原子化发送,触发多次重绘竞态;高 DPI 分数缩放下图标渲染时序问题导致图标偶现黑色。

修改内容

  • 修复主题切换事件的发送时序,确保原子化通知
  • 优化图标刷新逻辑,避免竞态条件下的错误渲染

关联

Summary by Sourcery

确保插件面板在主题切换时及时且一致地刷新图标与颜色状态。

Bug Fixes:

  • 修复高 DPI 分数缩放下切换深色模式时插件面板图标偶现显示为黑色的问题。

Enhancements:

  • 统一并延迟插件主题相关通知,确保颜色、主题和活动色变更以一致的时序发送,避免重复重绘竞态。

Use a debounce QTimer (single-shot, interval=0) to coalesce
color_theme_changed, theme_changed, and active_color_changed events
into one atomic send. This eliminates the race condition where three
separate Wayland events fired in the same event loop cycle caused
intermittent icon rendering failures during dark mode switching on
4K/225% scaling.

Replaces direct send calls in setDockColorTheme(), onThemeChanged(),
and onActiveColorChanged() with scheduleThemeNotify().
@deepin-ci-robot

Copy link
Copy Markdown

[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.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@sourcery-ai

sourcery-ai Bot commented Sep 8, 2026

Copy link
Copy Markdown

Reviewer's Guide

The plugin manager now coalesces the three theme-related notifications and sends them atomically in one deferred update, reducing redraw races that can cause black plugin-panel icons under high-DPI fractional scaling during dark-mode transitions.

Sequence diagram for coalesced plugin theme notification

sequenceDiagram
    participant Theme as DPlatformTheme
    participant Manager as PluginManager
    participant Timer as QTimer
    participant Surface as PluginSurface

    Theme->>Manager: onThemeChanged()
    Manager->>Manager: scheduleThemeNotify()
    Theme->>Manager: onActiveColorChanged()
    Manager->>Manager: scheduleThemeNotify()
    Manager->>Timer: start()
    Timer-->>Manager: timeout()
    Manager->>Surface: send_color_theme_changed()
    Manager->>Surface: send_theme_changed()
    Manager->>Surface: send_active_color_changed()
Loading

File-Level Changes

Change Details Files
Batch and coalesce theme-related Wayland notifications through a zero-delay single-shot timer.
  • Add a single-shot QTimer that defers notification delivery to the next event-loop turn.
  • Send dock color, theme/icon theme, and active-color updates together for every plugin surface.
  • Route dock color, theme, and active-color change handlers through the shared scheduling path.
panels/dock/pluginmanagerextension.cpp
panels/dock/pluginmanagerextension_p.h

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@deepin-ci-robot

Copy link
Copy Markdown

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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions 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.

@deepin-bot

deepin-bot Bot commented Sep 10, 2026

Copy link
Copy Markdown

TAG Bot

New tag: 2.0.54
DISTRIBUTION: unstable
Suggest: synchronizing this PR through rebase #1733

@deepin-bot

deepin-bot Bot commented Sep 22, 2026

Copy link
Copy Markdown

TAG Bot

New tag: 2.0.55
DISTRIBUTION: unstable
Suggest: synchronizing this PR through rebase #1752

@deepin-bot

deepin-bot Bot commented Sep 23, 2026

Copy link
Copy Markdown

TAG Bot

New tag: 2.0.56
DISTRIBUTION: unstable
Suggest: synchronizing this PR through rebase #1753

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants