Skip to content

feat(dock): migrate to treeland foreign toplevel manager v3 - #1789

Merged
deepin-bot[bot] merged 1 commit into
linuxdeepin:masterfrom
glyvut:master
Nov 3, 2026
Merged

deepin-bot[bot] merged 1 commit into
linuxdeepin:masterfrom
glyvut:master

Conversation

@glyvut

@glyvut glyvut commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Update taskmanager to the unstable v3 protocol and drop show_tooltip.

适配 treeland-foreign-toplevel-manager-unstable-v3 协议。

Log: 适配窗口管理协议 v3
PMS: TASK-396711
Influence: 任务栏窗口监控与预览改用 v3 协议,空窗口时不再显示文本 tooltip。

Summary by Sourcery

Update dock task management to use the Treeland foreign toplevel manager v3 protocol and remove empty-preview tooltips.

Enhancements:

  • Migrate dock task monitoring and window previews from the Treeland foreign toplevel manager v2 protocol to v3.
  • Require TreelandProtocols 0.9.0 for the updated Wayland protocol definitions.
  • Stop displaying text tooltips when no windows are available for preview.

@sourcery-ai

sourcery-ai Bot commented Nov 2, 2026

Copy link
Copy Markdown

Reviewer's Guide

The taskmanager now consumes Treeland’s unstable foreign toplevel and dock preview v3 protocols throughout its generated bindings, callback implementations, window-state mapping, and lifecycle handling; preview requests no longer fall back to a text tooltip when no windows are available.

Sequence diagram for v3 window monitoring and preview

sequenceDiagram
    participant Compositor as TreelandCompositor
    participant Manager as ForeignToplevelManager
    participant Handle as ForeignToplevelHandle
    participant Monitor as TreeLandWindowMonitor
    participant Preview as TreeLandDockPreviewContext

    Compositor->>Manager: treeland_foreign_toplevel_manager_v3_toplevel(toplevel)
    Manager->>Handle: ForeignToplevelHandle(toplevel)
    Compositor->>Handle: treeland_foreign_toplevel_handle_v3_pid(pid)
    Compositor->>Handle: treeland_foreign_toplevel_handle_v3_title(title)
    Compositor->>Handle: treeland_foreign_toplevel_handle_v3_state(state)
    Compositor->>Handle: treeland_foreign_toplevel_handle_v3_done()
    Handle-->>Monitor: handlerIsReady
    Monitor->>Preview: showWindowsPreview(windowsId, previewXoffset, previewYoffset, direction)
    Compositor->>Preview: treeland_dock_preview_context_v3_enter()
    Compositor->>Preview: treeland_dock_preview_context_v3_leave()
Loading

File-Level Changes

Change Details Files
Migrate taskmanager’s generated Wayland bindings and client-side foreign toplevel handling from protocol v2 to unstable v3.
  • Generate and include v3 protocol bindings.
  • Update manager and handle inheritance, constructors, callbacks, lifecycle hooks, and state constants to v3 types and event names.
  • Retain PID, title, app ID, identifier, state, readiness, and close-event propagation under the v3 callbacks.
panels/dock/taskmanager/CMakeLists.txt
panels/dock/taskmanager/treelandwindow.cpp
panels/dock/taskmanager/treelandwindow.h
panels/dock/taskmanager/treelandwindowmonitor.cpp
panels/dock/taskmanager/treelandwindowmonitor.h
Migrate dock preview context integration to the v3 protocol and remove fallback text tooltip behavior.
  • Update preview context types, constructors, enter/leave callbacks, and generated protocol bindings to v3.
  • Continue sending window preview data when windows are available.
  • Stop displaying the placeholder text tooltip when the preview list is empty or unavailable.
panels/dock/taskmanager/CMakeLists.txt
panels/dock/taskmanager/treelandwindowmonitor.cpp
panels/dock/taskmanager/treelandwindowmonitor.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

@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 ✨

18202781743
18202781743 previously approved these changes Nov 2, 2026
Update taskmanager to the unstable v3 protocol and drop show_tooltip.

适配 treeland-foreign-toplevel-manager-unstable-v3 协议。

Log: 适配窗口管理协议 v3
PMS: TASK-396711
Influence: 任务栏窗口监控与预览改用 v3 协议,空窗口时不再显示文本 tooltip。
@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: 18202781743, glyvut

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 Nov 3, 2026

Copy link
Copy Markdown

This pr force merged! (status: blocked)

@deepin-bot
deepin-bot Bot merged commit dea912e into linuxdeepin:master Nov 3, 2026
6 of 10 checks passed
@deepin-ci-robot

Copy link
Copy Markdown

deepin pr auto review

🤖 AI 代码审查报告

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

Pass


📊 总体评价

项目 结果
审查结论 代码审查通过
评分详情 本次提交将 dock 任务管理器的 treeland foreign toplevel manager 协议从 v2 迁移到 v3,变更内容为系统性的 API 版本升级,所有 v2 标识符一致地更新为 v3,依赖版本同步提升至 0.9.0,同时移除了两处使用占位符 "???" 的 tooltip 回退逻辑。四维度均无问题,代码安全无漏洞。

🔍 详细分析

1. 语法逻辑 ✅

评价: 语法正确,逻辑清晰 ✅ 通过

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

建议: []


2. 代码质量 ✅

评价: 代码结构清晰,注释完整 ✅ 通过

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

建议: ['建议在 requestPreview 函数中移除 else 分支处添加简短注释,说明 v3 协议不再需要 tooltip 回退逻辑,以便后续维护者理解。']


3. 代码性能 ✅

评价: 性能良好,资源使用合理 ✅ 通过

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

建议: []


4. 代码安全 🔒

评价: 存在0个安全漏洞 ✅ 通过

🔐 发现 0 个安全漏洞

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

建议: []


💡 改进建议代码示例

// 当前代码已无需修复。以下为 requestPreview 移除 else 分支后的推荐注释风格: // void TreeLandWindowMonitor::requestPreview(...) // { //     // v3 协议不再提供 show_tooltip 接口,仅支持 showWindowsPreview //     if (condition) { //         ... //         m_dockPreview->showWindowsPreview(byteArray, previewXoffset, previewYoffset, direction); //     } // }

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

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.

3 participants