Skip to content

fix(display): sync Treeland wallpaper previews - #3536

Draft
caixr23 wants to merge 1 commit into
masterfrom
agent/pms-bug-bot/b94e445f2db4
Draft

caixr23 wants to merge 1 commit into
masterfrom
agent/pms-bug-bot/b94e445f2db4

Conversation

@caixr23

@caixr23 caixr23 commented Sep 20, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Sync Treeland desktop wallpaper changes between the personalization and display plugins.
  • Resolve video wallpaper thumbnails by monitor name for immediate preview updates.
  • Rebind Treeland wallpaper contexts when the display page becomes active.

Multica issue

DDE-88

Test recommendations

  • Verify Treeland display previews update immediately after changing image wallpapers on primary and secondary screens.
  • Verify video wallpaper previews update immediately and show the expected thumbnail.
  • Verify X11 wallpaper preview behavior remains unchanged.

Summary by Sourcery

Synchronize Treeland wallpaper state across personalization and display pages to keep monitor previews current.

New Features:

  • Synchronize Treeland desktop wallpaper updates between the personalization and display plugins, including monitor-specific video thumbnail previews.

Bug Fixes:

  • Ensure Treeland display wallpaper previews refresh immediately when desktop wallpapers change and reconnect wallpaper contexts when the display page is reactivated.

Enhancements:

  • Add shared wallpaper synchronization state and notifications for cross-plugin wallpaper updates.

Build:

  • Link the display and personalization plugins with the shared utilities library.

1. Add an in-process WallpaperSync singleton shared by the display and
   personalization plugins
2. Publish desktop wallpaper source, monitor name, and source type after a
   successful Treeland wallpaper update
3. Apply synced wallpapers by monitor name and reuse video thumbnail
   resolution for video wallpapers
4. Rebind Treeland Wallpaper contexts when the display page is activated so
   the compositor can push its initial state
5. Keep the X11 DBus wallpaper refresh path unchanged

Log: Treeland display wallpaper previews now update immediately
Influence: Treeland wallpaper preview updates no longer require restarting the control center; X11 wallpaper preview behavior is unchanged

fix(display): 同步 Treeland 壁纸示意图

1. 新增显示与个性化插件共享的同进程 WallpaperSync 单例
2. Treeland 桌面壁纸设置成功后发布壁纸源、显示器名称和源类型
3. 按显示器名称应用同步壁纸,视频壁纸复用缩略图解析逻辑
4. 显示页面激活时重新绑定 Treeland Wallpaper 对象,触发合成器推送初始状态
5. 保持 X11 的 DBus 壁纸刷新路径不变

Log: Treeland 显示壁纸示意图可立即更新
Influence: Treeland 壁纸示意图更新不再需要重启控制中心;X11 壁纸示意图行为不变

PMS: BUG-372289
@deepin-ci-robot

Copy link
Copy Markdown

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: caixr23

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 20, 2026

Copy link
Copy Markdown

Reviewer's Guide

Adds a shared wallpaper synchronization channel between Treeland personalization and display plugins, allowing immediate per-monitor image and video preview updates, and refreshes wallpaper contexts when the display page is reactivated while preserving existing X11 behavior.

Sequence diagram for Treeland wallpaper preview synchronization

sequenceDiagram
    participant Personalization as TreelandPersonalization
    participant Sync as WallpaperSync
    participant Display as DisplayWorker
    participant Monitor as TreelandMonitor

    Personalization->>Sync: setWallpaper(monitorName, dest, type)
    Sync-->>Display: wallpaperChanged(monitorName, source, sourceType)
    alt VideoSourceType
        Display->>Display: resolveVideoThumbnail(source, monitor)
    end
    Display->>Monitor: setWallpaper(wallpaper)
Loading

Flow diagram for rebinding Treeland wallpaper contexts

flowchart LR
    A[Display page becomes active] --> B{Treeland mode}
    B -->|Yes| C["rebindWallpaperContexts()"]
    C --> D["removeWallpaper(output)"]
    D --> E["ensureWallpaperContext(screen)"]
    E --> F[Refresh per-monitor wallpaper previews]
    B -->|No| G[Preserve existing X11 behavior]
Loading

File-Level Changes

Change Details Files
Introduces a shared, application-thread-safe wallpaper synchronization service to propagate Treeland desktop wallpaper updates between plugins.
  • Adds a QObject singleton storing per-monitor wallpaper source and type.
  • Emits deduplicated wallpaper change notifications.
  • Uses queued invocation to update the shared state from the personalization worker.
  • Links both plugins against the shared utility library.
src/shared-utils/wallpapersync.h
src/shared-utils/wallpapersync.cpp
src/shared-utils/CMakeLists.txt
src/plugin-display/CMakeLists.txt
src/plugin-personalization/CMakeLists.txt
src/plugin-personalization/operation/treelandworker.cpp
Updates the Treeland display worker to consume synchronized wallpaper changes and refresh previews by monitor.
  • Connects to wallpaper synchronization notifications during Treeland initialization.
  • Resolves video wallpaper sources to monitor-specific thumbnails before applying them.
  • Matches synchronized changes to Wayland monitors by name and updates their wallpaper preview.
src/plugin-display/operation/private/displayworker.cpp
src/plugin-display/operation/private/displayworker.h
Rebinds Treeland wallpaper contexts when the display page becomes active.
  • Removes existing wallpaper contexts for tracked screens.
  • Recreates contexts so previews reflect the latest wallpaper state after page activation.
src/plugin-display/operation/private/displayworker.cpp
src/plugin-display/operation/private/displayworker.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

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants