Skip to content

feat: add output-uuid protocols for stable output identity - #122

Merged
Groveer merged 1 commit into
linuxdeepin:masterfrom
wineee:output-uuid-protocol
Oct 20, 2026
Merged

Groveer merged 1 commit into
linuxdeepin:masterfrom
wineee:output-uuid-protocol

Conversation

@wineee

@wineee wineee commented Oct 15, 2026 •

Copy link
Copy Markdown
Member
  1. Add treeland-output-uuid-unstable-v1.xml: treeland_output_uuid_manager_v1 .get_uuid creates a treeland_output_uuid_v1 object (frozen at v1) whose uuid event reports a stable opaque uuid for a wl_output.
  2. Add treeland-output-uuid-head-unstable-v1.xml: companion factory treeland_output_uuid_head_manager_v1 returning the same treeland_output_uuid_v1 object from a zwlr_output_head_v1, covering disabled outputs with no live wl_output global.
  3. Register both files in TREELAND_PROTOCOL_DDE_XML_FILES and add their rows to the dde README.md / README.zh_CN.md protocol tables.

Log: New experimental protocols expose a stable opaque uuid identity for physical output devices via wl_output and zwlr_output_head_v1 factories; no existing protocol is modified.

Influence:

  1. Verify wayland-scanner generates client/server headers and code for both new XMLs without errors.
  2. Verify cmake configure/build/install places both XMLs under share/treeland-protocols.
  3. Verify the uuid-head client code links against treeland_output_uuid_v1_interface generated by the uuid protocol.
  4. Verify dde README.md and README.zh_CN.md protocol tables contain matching rows for both new protocols.

feat: 新增 output-uuid 协议,提供稳定的输出身份

  1. 新增 treeland-output-uuid-unstable-v1.xml: treeland_output_uuid_manager_v1.get_uuid 创建 treeland_output_uuid_v1 对象(冻结于 v1),其 uuid 事件为 wl_output 上报稳定不透明的 uuid。
  2. 新增 treeland-output-uuid-head-unstable-v1.xml:配套工厂 treeland_output_uuid_head_manager_v1 从 zwlr_output_head_v1 返回 同一个 treeland_output_uuid_v1 对象,涵盖无存活 wl_output 全局 的禁用输出。
  3. 将两个文件注册进 TREELAND_PROTOCOL_DDE_XML_FILES,并在 dde README.md / README.zh_CN.md 协议表中新增对应行。

Log: 新增实验性协议,通过 wl_output 与 zwlr_output_head_v1 两个工厂 暴露物理输出设备的稳定不透明 uuid 身份;不修改任何现有协议。

Influence:

  1. 验证 wayland-scanner 对两个新 XML 生成 client/server 头文件与 代码无报错。
  2. 验证 cmake 配置/构建/安装将两个 XML 装入 share/treeland-protocols。
  3. 验证 uuid-head 客户端代码能链接由 uuid 协议生成的 treeland_output_uuid_v1_interface。
  4. 验证 dde README.md 与 README.zh_CN.md 协议表含两个新协议的 对应行且内容一致。

Summary by Sourcery

Expose stable physical-output UUID identity through complementary Wayland output and output-head protocols.

New Features:

  • Add experimental protocols that expose stable opaque UUIDs for physical outputs through both wl_output and zwlr_output_head_v1.
  • Support identifying disabled outputs that do not have a live wl_output global while sharing UUID identity across both protocol entry points.

Enhancements:

  • Register the new protocols in the build and installation protocol set.
  • Document both protocols in the English and Chinese protocol tables.

@sourcery-ai

sourcery-ai Bot commented Oct 15, 2026

Copy link
Copy Markdown

Sorry @wineee, you've used your own review budget of 250,000 diff characters for the last 7 days.

You can request another review in 1 day and 5 hours by commenting @sourcery-ai review. Upgrade to get a review now.

@sourcery-ai

sourcery-ai Bot commented Oct 15, 2026

Copy link
Copy Markdown

Reviewer's Guide

Adds two experimental output-UUID protocols: a frozen shared interface with a wl_output factory and a companion zwlr_output_head_v1 factory for stable physical-output identity, then registers and documents both protocols for installation.

Sequence diagram for obtaining a stable output UUID

sequenceDiagram
    participant Client
    participant UuidManager as treeland_output_uuid_manager_v1
    participant Output as wl_output
    participant Uuid as treeland_output_uuid_v1

    Client->>UuidManager: get_uuid(Output)
    UuidManager-->>Client: create Uuid
    Uuid-->>Client: uuid(uuid)
    Note over Uuid: Frozen v1 identity object
Loading

Sequence diagram for identifying a disabled output through an output head

sequenceDiagram
    participant Client
    participant HeadManager as treeland_output_uuid_head_manager_v1
    participant Head as zwlr_output_head_v1
    participant Uuid as treeland_output_uuid_v1

    Client->>HeadManager: get_uuid(Head)
    HeadManager-->>Client: create Uuid
    Uuid-->>Client: uuid(uuid)
    Note over Head: Works without a live wl_output global
Loading

File-Level Changes

Change Details Files
Define a frozen v1 output-identity protocol that exposes stable opaque UUIDs through wl_output objects.
  • Add a manager factory for creating UUID objects from wl_output.
  • Emit an initial and change-notification uuid event with documented persistence, opacity, and lifetime semantics.
  • Mark the shared UUID interface frozen at version 1 for use by multiple factories.
dde/treeland-output-uuid-unstable-v1.xml
Add a companion protocol for resolving the same output identity from wlr output heads, including disabled outputs.
  • Add a head manager factory accepting zwlr_output_head_v1 objects.
  • Return the shared treeland_output_uuid_v1 interface used by the primary protocol.
  • Document identity sharing and support for heads without live wl_output globals.
dde/treeland-output-uuid-head-unstable-v1.xml
Integrate both experimental protocol XMLs into distribution metadata and documentation.
  • Register both XML files in the CMake installation list.
  • Add matching English and Chinese protocol-table entries.
  • Ensure generated code can reference the shared UUID interface across the two protocol definitions.
CMakeLists.txt
dde/README.md
dde/README.zh_CN.md

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

@wineee

wineee commented Oct 15, 2026

Copy link
Copy Markdown
Member Author

#109 的一部分

@wineee
wineee force-pushed the output-uuid-protocol branch 2 times, most recently from 0d3b08e to ca3dc03 Compare October 16, 2026 08:55
1. Add treeland-output-uuid-unstable-v1.xml: treeland_output_uuid_manager_v1
   .get_uuid creates a treeland_output_uuid_v1 object (frozen at v1) whose
   uuid event reports a stable opaque uuid for a wl_output.
2. Add treeland-output-uuid-head-unstable-v1.xml: companion factory
   treeland_output_uuid_head_manager_v1 returning the same
   treeland_output_uuid_v1 object from a zwlr_output_head_v1, covering
   disabled outputs with no live wl_output global.
3. Register both files in TREELAND_PROTOCOL_DDE_XML_FILES and add their
   rows to the public README.md / README.zh_CN.md protocol tables.

Log: New experimental protocols expose a stable opaque uuid identity for
physical output devices via wl_output and zwlr_output_head_v1 factories;
no existing protocol is modified.

Influence:
1. Verify wayland-scanner generates client/server headers and code for
   both new XMLs without errors.
2. Verify cmake configure/build/install places both XMLs under
   share/treeland-protocols.
3. Verify the uuid-head client code links against
   treeland_output_uuid_v1_interface generated by the uuid protocol.
4. Verify dde README.md and README.zh_CN.md protocol tables contain
   matching rows for both new protocols.

feat: 新增 output-uuid 协议,提供稳定的输出身份

1. 新增 treeland-output-uuid-unstable-v1.xml:
   treeland_output_uuid_manager_v1.get_uuid 创建
   treeland_output_uuid_v1 对象(冻结于 v1),其 uuid 事件为
   wl_output 上报稳定不透明的 uuid。
2. 新增 treeland-output-uuid-head-unstable-v1.xml:配套工厂
   treeland_output_uuid_head_manager_v1 从 zwlr_output_head_v1 返回
   同一个 treeland_output_uuid_v1 对象,涵盖无存活 wl_output 全局
   的禁用输出。
3. 将两个文件注册进 TREELAND_PROTOCOL_DDE_XML_FILES,并在 public
   README.md / README.zh_CN.md 协议表中新增对应行。

Log: 新增实验性协议,通过 wl_output 与 zwlr_output_head_v1 两个工厂
暴露物理输出设备的稳定不透明 uuid 身份;不修改任何现有协议。

Influence:
1. 验证 wayland-scanner 对两个新 XML 生成 client/server 头文件与
   代码无报错。
2. 验证 cmake 配置/构建/安装将两个 XML 装入 share/treeland-protocols。
3. 验证 uuid-head 客户端代码能链接由 uuid 协议生成的
   treeland_output_uuid_v1_interface。
4. 验证 dde README.md 与 README.zh_CN.md 协议表含两个新协议的
   对应行且内容一致。
@wineee
wineee force-pushed the output-uuid-protocol branch from ca3dc03 to c5d09b1 Compare October 16, 2026 09:17
@deepin-ci-robot

Copy link
Copy Markdown

deepin pr auto review

🤖 AI 代码审查报告

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

Pass


📊 总体评价

项目 结果
审查结论 代码审查通过
评分详情 总体评分 100 分,大于 70 分通过阈值,代码质量符合要求。本次 PR 新增两个 Wayland 协议 XML 文件(treeland-output-uuid-unstable-v1.xml 和 treeland-output-uuid-head-unstable-v1.xml),提供稳定的输出设备 UUID 身份标识。协议设计规范、文档完整、无安全漏洞。

🔍 详细分析

1. 语法逻辑 ✅

评价: 优秀 ✅ 通过

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

建议: 语法正确,逻辑清晰。协议设计遵循 Wayland 标准模式,工厂接口与对象接口分离,对象生命周期管理完善。建议保持 frozen 接口的不变性约束。


2. 代码质量 ✅

评价: 优秀 ✅ 通过

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

建议: 代码结构清晰,注释完整。协议文档详尽,包含设计意图、使用场景和约束条件。中英文 README 同步更新,保持一致性。建议在后续版本中考虑添加 error 枚举定义以处理异常场景。


3. 代码性能 ✅

评价: 优秀 ✅ 通过

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

建议: 性能良好,资源使用合理。协议设计简洁高效,通信开销最小化。无性能瓶颈。


4. 代码安全 🔒

评价: 优秀 ✅ 通过

🔐 发现 0 个安全漏洞

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

建议: 存在0个安全漏洞。协议设计中 UUID 被明确定义为不透明字符串,要求客户端不得解析或推导其内容。CMakeLists.txt 仅新增文件路径,无命令注入风险。XML 协议文件不涉及用户输入处理、网络通信或敏感信息。对象生命周期管理通过 destructor 请求正确处理,无资源泄漏风险。安全合规。


💡 改进建议代码示例

// 本次 PR 为新增 Wayland 协议定义文件,代码质量优秀,无需修复示例。
// 协议设计遵循 Wayland 标准规范,文档完整,无安全漏洞。

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

@Groveer
Groveer added this pull request to the merge queue Oct 20, 2026
@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Groveer, wineee, zzxyb

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

Merged via the queue into linuxdeepin:master with commit 837d685 Oct 20, 2026
5 checks passed
@wineee
wineee deleted the output-uuid-protocol branch October 20, 2026 03:17
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