Skip to content

feat: adapt taskmanager to v2 toplevel protocol - #1728

Merged
deepin-bot[bot] merged 1 commit into
linuxdeepin:masterfrom
deepin-wm:agent/dde-pl/2835f1be3a10
Sep 9, 2026
Merged

deepin-bot[bot] merged 1 commit into
linuxdeepin:masterfrom
deepin-wm:agent/dde-pl/2835f1be3a10

Conversation

@deepin-wm

@deepin-wm deepin-wm commented Sep 9, 2026 •

Copy link
Copy Markdown

Summary

Adapt the dock taskmanager module from treeland-foreign-toplevel-manager-v1 to treeland-foreign-toplevel-manager-unstable-v2 protocol.

Changes (5 files, 39 insertions, 39 deletions)

  1. CMakeLists.txt: Protocol XML reference updated from v1 to unstable-v2
  2. treelandwindow.h / treelandwindow.cpp: All Wayland class, namespace, and method references renamed from v1 to v2; constructor version changed from 2 to 1; set_rectangle request renamed to set_icon_geometry
  3. treelandwindowmonitor.h / treelandwindowmonitor.cpp: ForeignToplevelManager and TreeLandDockPreviewContext class/namespace/method references updated from v1 to v2; manager constructor version changed from 2 to 1

Multica Issue

DDE-230

Summary by Sourcery

Migrate the dock task manager from the Treeland foreign toplevel manager v1 protocol to unstable v2.

New Features:

  • Update the dock task manager to use the Treeland foreign toplevel manager unstable v2 protocol.

Enhancements:

  • Align task window handling, monitoring, preview contexts, and icon geometry requests with the v2 Wayland protocol API.

Build:

  • Generate Wayland client bindings from the unstable v2 protocol definition.

@deepin-wm
deepin-wm marked this pull request as draft September 9, 2026 08:09
@sourcery-ai

sourcery-ai Bot commented Sep 9, 2026

Copy link
Copy Markdown

Reviewer's Guide

Migrates the dock taskmanager’s Treeland foreign-toplevel and dock-preview Wayland client usage from the v1 protocol to unstable-v2, including generated bindings, callback signatures, protocol object types, extension versions, state enums, and the icon-geometry request.

Sequence diagram for v2 toplevel discovery and updates

sequenceDiagram
    participant Manager as ForeignToplevelManager
    participant Monitor as TreeLandWindowMonitor
    participant Handle as ForeignToplevelHandle
    participant Window as TreeLandWindow

    Manager->>Handle: treeland_foreign_toplevel_manager_v2_toplevel(toplevel)
    Handle-->>Handle: treeland_foreign_toplevel_handle_v2_pid(pid)
    Handle-->>Handle: treeland_foreign_toplevel_handle_v2_title(title)
    Handle-->>Handle: treeland_foreign_toplevel_handle_v2_app_id(app_id)
    Handle-->>Handle: treeland_foreign_toplevel_handle_v2_state(state)
    Handle-->>Handle: treeland_foreign_toplevel_handle_v2_done()
    Handle-->>Monitor: handlerIsReady
    Monitor->>Window: handleForeignToplevelHandleAdded
Loading

File-Level Changes

Change Details Files
Switch the taskmanager’s generated Wayland client bindings and C++ integration from the v1 protocol to unstable-v2.
  • Generate client sources from the unstable-v2 protocol XML.
  • Update handle, manager, and preview-context inheritance, object types, namespaces, and event callbacks to v2.
  • Adjust client extension version arguments from 2 to 1 for the v2 protocol.
  • Map window state constants to v2 and rename the geometry request to set_icon_geometry.
panels/dock/taskmanager/CMakeLists.txt
panels/dock/taskmanager/treelandwindow.h
panels/dock/taskmanager/treelandwindow.cpp
panels/dock/taskmanager/treelandwindowmonitor.h
panels/dock/taskmanager/treelandwindowmonitor.cpp

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

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

@wineee
wineee marked this pull request as ready for review September 9, 2026 09:14
18202781743
18202781743 previously approved these changes Sep 9, 2026
@deepin-ci-robot

Copy link
Copy Markdown

deepin pr auto review

🤖 AI 代码审查报告

总体评分: 98 分 (通过阈值: 70分)

Pass


📊 总体评价

项目 结果
审查结论 代码审查通过
评分详情 本次提交将 taskmanager 从 treeland-foreign-toplevel-manager-v1 协议适配到 v2 协议,变更内容为协议版本升级相关的 API 重命名和头文件引用更新。所有 v1 到 v2 的重命名在 .h 和 .cpp 文件中保持一致,set_rectangle 到 set_icon_geometry 的重命名符合 v2 协议规范。ForeignToplevelManager 模板新增 destroy 函数指针参数,改进了资源清理。未发现安全漏洞,未引入新的逻辑或性能问题。

🔍 详细分析

1. 语法逻辑 ✅

评价: 优秀 ✅ 通过

潜在问题:
✅ 未发现明显问题

建议: ['所有 v1 到 v2 的类型名、方法名重命名在头文件和源文件中保持完全一致,包括 treeland_foreign_toplevel_handle_v1 → v2、treeland_foreign_toplevel_manager_v1 → v2、treeland_dock_preview_context_v1 → v2', 'QWaylandClientExtensionTemplate 版本号从 2 改为 1 是正确的,v2 协议作为新版本从 implementation version 1 开始', 'set_rectangle → set_icon_geometry 方法重命名符合 v2 协议 API 变更', 'ForeignToplevelManager 模板新增 &QtWayland::treeland_foreign_toplevel_manager_v2::destroy 作为第二个模板参数,确保协议对象在析构时正确调用 destroy 请求']


2. 代码质量 ✅

评价: 优秀 ✅ 通过

潜在问题:

  1. panels/dock/taskmanager/treelandwindow.h:17 - 协议版本迁移缺少注释说明 v1 到 v2 的变更原因和差异

建议: ['代码结构保持良好,类继承关系清晰', '所有 override 方法正确声明,符合 C++ 最佳实践']


3. 代码性能 ✅

评价: 优秀 ✅ 通过

潜在问题:
✅ 未发现明显问题

建议: ['本次变更为纯 API 重命名和协议迁移,不影响运行时性能', 'ForeignToplevelManager 新增 destroy 模板参数改进了资源生命周期管理']


4. 代码安全 🔒

评价: 优秀 ✅ 通过

🔐 发现 0 个安全漏洞

安全漏洞详情:
✅ 未发现安全漏洞

建议: ['本次协议迁移未引入新的安全风险', '未涉及用户输入处理、文件操作或网络通信等安全敏感操作']


💡 改进建议代码示例

// 暂无代码示例

本报告由 AI 代码审查工具自动生成

1. Update protocol XML reference from v1 to unstable-v2 in CMakeLists
2. Rename all Wayland class, namespace, and method references from v1 to v2
3. Change QWaylandClientExtensionTemplate constructor version from 2 to 1
4. Rename set_rectangle request to set_icon_geometry in treelandwindow
5. Update include headers to unstable-v2 generated header

Influence:
1. Verify dock taskmanager window listing and management under v2 protocol
2. Test window preview functionality with treeland compositor v2 support
3. Verify window icon geometry setting for minimize-to-dock behavior

feat: 适配 taskmanager 至 v2 toplevel 协议

1. 在 CMakeLists 中将协议 XML 引用从 v1 更新为 unstable-v2
2. 将所有 Wayland 类、命名空间及方法引用从 v1 重命名为 v2
3. 将 QWaylandClientExtensionTemplate 构造版本从 2 改为 1
4. 在 treelandwindow 中将 set_rectangle 请求重命名为 set_icon_geometry
5. 更新 include 头文件为 unstable-v2 生成的头文件

Influence:
1. 验证 v2 协议下任务栏 taskmanager 窗口列表和管理功能
2. 在 treeland 合成器 v2 支持下测试窗口预览功能
3. 验证窗口图标几何位置设置用于最小化到任务栏的行为
@18202781743
18202781743 force-pushed the agent/dde-pl/2835f1be3a10 branch from c64ece4 to d00e3cc Compare September 9, 2026 10:10
@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: 18202781743, deepin-wm

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

Copy link
Copy Markdown
Contributor

/forcemerge

@deepin-bot

deepin-bot Bot commented Sep 9, 2026

Copy link
Copy Markdown

This pr force merged! (status: blocked)

@deepin-bot
deepin-bot Bot merged commit b80d124 into linuxdeepin:master Sep 9, 2026
6 of 10 checks passed
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.

4 participants