Skip to content

fix: 适配 Treeland 个性化协议变更 - #3574

Draft
18202781743 wants to merge 1 commit into
masterfrom
agent/developer/dcc
Draft

18202781743 wants to merge 1 commit into
masterfrom
agent/developer/dcc

Conversation

@18202781743

@18202781743 18202781743 commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

适配 Treeland 个性化协议变更

将旧的 treeland-personalization-manager-v1 协议替换为新的 treeland-appearance-manager-unstable-v1(特权写入)和 treeland-appearance-unstable-v1(只读事件)协议。

变更内容

  1. plugin-personalization: 迁移 TreelandWorker 至新协议接口,适配 appearance/cursor/font 等接口替换
  2. plugin-mouse: 迁移 TreelandWorker 至新协议接口,光标大小设置直接通过 set_cursor_size 调用

关联信息

Summary by Sourcery

将 Treeland 个性化集成迁移到新的外观协议接口。

Bug Fixes:

  • 适配 Treeland 外观协议变更,恢复个性化和鼠标插件在新协议下的主题、字体、光标及外观设置与事件同步。

Enhancements:

  • 将 Treeland 集成从旧个性化管理协议迁移至新的特权外观管理协议和只读外观事件协议。

Build:

  • 将 TreelandProtocols 依赖升级要求调整为 0.7.0,并生成新的外观协议客户端代码。

@sourcery-ai

sourcery-ai Bot commented Oct 16, 2026

Copy link
Copy Markdown

Reviewer's Guide

本 PR 将两个 Treeland 插件从旧的 personalization manager v1 迁移至 0.7.0 引入的 appearance manager/appearance 协议:写操作集中经特权 manager 发出,读取事件由 appearance 对象接收,同时重构各类外观、光标和字体接口映射及参数转换。

Sequence diagram for Treeland appearance updates

sequenceDiagram
    participant Worker as TreeLandWorker
    participant Manager as TreelandAppearanceManager
    participant Compositor as Treeland
    participant Appearance as TreelandAppearance

    Worker->>Manager: setAppearanceTheme(id, keepAuto)
    Manager->>Compositor: set_color_scheme(0 or 1)
    Compositor-->>Appearance: color_scheme(scheme)
    Appearance-->>Worker: colorSchemeChanged(scheme)

    Worker->>Manager: setFontName(fontName)
    Manager->>Compositor: set_font(fontName)

    Worker->>Manager: setCursorTheme(id)
    Manager->>Compositor: set_cursor_theme(id)
Loading

File-Level Changes

Change Details Files
将 Treeland 客户端协议从旧 personalization manager/context 迁移到 appearance manager(特权写入)和 appearance(只读事件)接口,并统一更新 Wayland 协议生成与构建依赖。
  • 要求 TreelandProtocols 版本至少为 0.7.0,并生成新的 appearance 相关协议代码。
  • 以 TreelandAppearanceManager 替换旧管理器,负责协议发现、生命周期和特权属性写入。
  • 以单一 TreelandAppearance 对象替换原有外观、光标和字体 context。
src/plugin-mouse/CMakeLists.txt
src/plugin-mouse/operation/treelandworker.cpp
src/plugin-mouse/operation/treelandworker.h
src/plugin-personalization/CMakeLists.txt
src/plugin-personalization/operation/treelandworker.cpp
src/plugin-personalization/operation/treelandworker.h
迁移个性化设置的读写映射到新的 appearance 协议方法,并处理新的事件回调。
  • 将主题、字体、图标、光标、强调色、字号、标题栏高度、圆角和透明度写入改为 appearance manager 调用。
  • 将颜色方案事件转换为模型主题状态更新,并移除旧 context 的回调与初始化逻辑。
  • 按新协议的数值表示转换颜色、透明度和字号等参数。
src/plugin-personalization/operation/treelandworker.cpp
调整鼠标插件的光标设置路径,直接通过 appearance manager 写入。
  • 移除独立光标 context 的创建、提交和销毁。
  • 使用 set_cursor_size(size, size) 设置光标尺寸,并保留管理器激活状态处理。
src/plugin-mouse/operation/treelandworker.cpp
src/plugin-mouse/operation/treelandworker.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

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: 18202781743

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

@18202781743
18202781743 force-pushed the agent/developer/dcc branch 4 times, most recently from da91adf to 6e072d1 Compare October 20, 2026 08:49
@18202781743
18202781743 requested a review from mhduiy October 20, 2026 08:49
1. Replace treeland-personalization-manager-v1 with treeland-appearance-manager-v1 and treeland-appearance-v1
2. Migrate plugin-personalization TreelandWorker to new protocol APIs
3. Migrate plugin-mouse TreelandWorker to new protocol APIs
4. Use color_scheme enum instead of bare integers in set_color_scheme
5. Multiply font point size by 10 in set_font_size to match treeland protocol
6. Fill accent_color, titlebar_height, corner_radius appearance event callbacks
7. Remove dead init() and self-made Wayland platform checks
8. Add runtime Wayland session guard for treelandworker active in mouse plugin
9. Add !keepAuto gate to auto branch handleGlobalTheme call for consistency

Log: Adapt dde-control-center to Treeland appearance protocol migration
Influence:
1. Test cursor size setting in mouse plugin
2. Test appearance theme, font, icon, cursor, active color, font size, opacity settings in personalization plugin
3. Verify wallpaper and global theme switching still works
4. Verify font size setting takes effect correctly
5. Verify color scheme switching works correctly
6. Verify no crash under X11 session

fix: 适配 Treeland 个性化协议变更

1. 将 treeland-personalization-manager-v1 替换为 treeland-appearance-manager-v1 和 treeland-appearance-v1
2. 迁移 plugin-personalization TreelandWorker 至新协议接口
3. 迁移 plugin-mouse TreelandWorker 至新协议接口
4. 在 set_color_scheme 中使用 color_scheme 枚举替代裸整数
5. set_font_size 中字体磅值乘以 10 匹配 treeland 协议约定
6. 补充 accent_color、titlebar_height、corner_radius 外观事件回调
7. 移除无用的 init() 及自定义 Wayland 平台判断
8. 为鼠标插件 treelandworker 的 active 调用补充运行时 Wayland 会话守卫
9. 为 auto 分支 handleGlobalTheme 调用添加 !keepAuto 门控保持一致性

Log: 适配 dde-control-center 至 Treeland appearance 协议迁移
Influence:
1. 测试鼠标插件中光标大小设置功能
2. 测试个性化插件中主题、字体、图标、光标、活动色、字体大小、透明度设置
3. 验证壁纸和全局主题切换功能正常
4. 验证字体大小设置生效正确
5. 验证色彩模式切换正常
6. 验证 X11 会话下无崩溃

PMS: TASK-396717
@deepin-bot

deepin-bot Bot commented Oct 20, 2026

Copy link
Copy Markdown

TAG Bot

New tag: 6.1.112
DISTRIBUTION: unstable
Suggest: synchronizing this PR through rebase #3578

@deepin-bot

deepin-bot Bot commented Oct 21, 2026

Copy link
Copy Markdown

TAG Bot

New tag: 6.1.113
DISTRIBUTION: unstable
Suggest: synchronizing this PR through rebase #3581

This branch has not been deployed

No deployments
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