Skip to content

feat(protocol): add treeland-window-animation-v1 protocol - #94

Merged
wineee merged 1 commit into
linuxdeepin:masterfrom
glyvut:feat/animation-new
Sep 15, 2026
Merged

wineee merged 1 commit into
linuxdeepin:masterfrom
glyvut:feat/animation-new

Conversation

@glyvut

@glyvut glyvut commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Persistent, updatable rect object for window open/close animation:

  • Renamed from treeland-launch-animation-v1 to treeland-window-animation-v1
  • Rect object survives commit; client may call set_geometry + commit repeatedly
  • Close animation transitions back to the rect
  • Destroying the rect falls back to default close animation
  • Removed already_committed error; commit is repeatable

Summary by Sourcery

Add an experimental protocol for configurable window open and close transitions tied to activation tokens.

New Features:

  • Add an experimental window transition protocol for rectangle-based open and close animations, with optional source images.
  • Support persistent transition rectangles that can be updated or temporarily disabled while the target window remains alive.

Enhancements:

  • Define fallback behavior for destroyed or unavailable transition rectangles and notify clients when the associated target window closes.

Build:

  • Install the new public window transition protocol XML.

Documentation:

  • Document the new window transition protocol in English and Chinese public protocol indexes.

@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

@sourcery-ai

sourcery-ai Bot commented Aug 28, 2026

Copy link
Copy Markdown

Reviewer's Guide

Adds and publishes an experimental treeland_window_animation_unstable_v1 protocol that associates persistent, updatable rectangles and optional source images with activation tokens for window open/close animations, including lifecycle and fallback semantics.

Sequence diagram for activation-token window animation

sequenceDiagram
    participant A as OriginatingClient
    participant M as AnimationManager
    participant R as AnimationRect
    participant T as ActivationToken
    participant B as TargetClient
    participant C as Compositor

    A->>M: get_window_animation_rect(R, T)
    A->>R: set_geometry(x, y, width, height)
    A->>R: commit()
    A->>T: commit()
    A->>B: Pass activation token
    B->>C: activate(token, target_surface)
    C->>C: Play open animation from rectangle
    A->>R: set_geometry(...)
    A->>R: commit()
    B->>C: Close target window
    C->>C: Play close animation to latest rectangle
    C-->>R: closed
Loading

State diagram for persistent window animation rectangle

stateDiagram-v2
    [*] --> Uncommitted
    Uncommitted --> Committed: set_geometry + commit
    Committed --> Committed: set_geometry + commit
    Committed --> Disabled: set_geometry(0, 0, 0, 0) + commit
    Disabled --> Committed: set_geometry(...positive size...) + commit
    Committed --> Closed: target window destroyed
    Disabled --> Closed: target window destroyed
    Committed --> Fallback: destroy / client disconnect / originating surface destroyed
    Disabled --> Fallback: destroy / client disconnect / originating surface destroyed
    Closed --> [*]
    Fallback --> [*]
Loading

File-Level Changes

Change Details Files
Introduce the experimental persistent window-animation protocol and publish its XML interface.
  • Define manager and rectangle interfaces tied to xdg-activation tokens.
  • Support geometry commits that can be repeated, updated, or disabled with 0x0 size.
  • Specify optional source-buffer handling, lifecycle events, validation errors, and fallback behavior.
  • Install the protocol XML through the build and list it in English and Chinese public indexes.
public/treeland-window-animation-unstable-v1.xml
CMakeLists.txt
public/README.md
public/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

@glyvut
glyvut force-pushed the feat/animation-new branch 2 times, most recently from 91ef201 to 6bb52fd Compare September 1, 2026 06:31
@wineee
wineee requested a lite review from Copilot September 3, 2026 03:08

Copilot AI 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.

🟡 Changes recommended

The new protocol spec needs adjustments to match established repo protocol naming/structure conventions and to resolve clarity/consistency issues in the XML text.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Adds a new public Wayland protocol XML specifying a rectangle-driven open/close window animation workflow tied to xdg-activation-v1, including a persistent rect object with repeatable commits and an optional source image buffer.

Changes:

  • Introduces treeland-window-animation-v1 protocol with manager + rect interfaces, geometry/commit workflow, optional wl_buffer source image, and a closed event.
  • Registers the new protocol in the public protocols README table.
  • Adds the protocol XML to TREELAND_PROTOCOL_XML_FILES for installation/packaging.
File summaries
File Description
public/treeland-window-animation-v1.xml New protocol specification for rectangle-based window open/close animations with optional source buffer and persistent updates.
public/README.md Documents the newly added public protocol in the protocol table.
CMakeLists.txt Installs/packages the new public protocol XML by adding it to the public list.
Review details

Suppressed comments (3)

public/treeland-window-animation-v1.xml:156

  • The protocol rules for this repo recommend keeping enums before requests and keeping all requests before any events. In treeland_window_animation_rect_v1, the closed event appears before set_geometry/commit/set_source_buffer, and the error enum is last; please reorder the members to match the recommended layout (description -> enums -> destroy -> requests -> events) for consistency and easier diff review in future versions.
        <event name="closed">
            <description summary="the target window has been destroyed">
                Sent once the target window associated with this rectangle has

public/treeland-window-animation-v1.xml:77

  • This protocol text uses RFC 2119-style normative keywords (e.g. “MUST”, “SHOULD”) but does not include the RFC 2119 interpretation paragraph. Per the repo protocol rules, either add the RFC 2119 paragraph to the top-level <description> and use lowercase keywords consistently, or avoid normative keywording entirely to prevent ambiguous conformance requirements.
        The client MUST call xdg_activation_v1.activate on the target
        surface before that surface is first mapped (i.e. before the
        wl_surface.commit that causes the compositor to map it). This
        ensures the compositor has the animation rectangle available when
        the surface appears.

public/treeland-window-animation-v1.xml:169

  • The closed event description is internally contradictory (“creates a rectangle per long-lived target window” vs “reuse the rectangle for further target windows”), which makes the intended lifetime guidance unclear. Please reword this section to clearly separate the “reuse one rectangle” vs “create one rectangle per target window” patterns.
                long-lived target window can reuse the rectangle for further
                target windows; a client that creates a new rectangle for each
                target window SHOULD destroy the rectangle upon receiving this
                event so it does not accumulate rectangles for windows that are
                already gone.
  • Files reviewed: 3/3 changed files
  • Comments generated: 3
  • Review effort level: Lite

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread CMakeLists.txt
Comment thread public/README.md Outdated
Comment thread public/treeland-window-animation-v1.xml Outdated
@glyvut
glyvut force-pushed the feat/animation-new branch 2 times, most recently from 0ef59fd to 289a095 Compare September 9, 2026 02:47
@glyvut
glyvut marked this pull request as ready for review September 9, 2026 02:47

@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 found 1 issue

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="public/treeland-window-animation-unstable-v1.xml" line_range="157" />
<code_context>
+                destroying it via the destroy request. The compositor never
+                destroys client objects. A client that creates a rectangle per
+                long-lived target window can reuse the rectangle for further
+                target windows; a client that creates a new rectangle for each
+                target window SHOULD destroy the rectangle upon receiving this
+                event so it does not accumulate rectangles for windows that are
</code_context>
<issue_to_address>
**issue (bug_risk):** The `closed` event documentation claims a rectangle can be reused for further target windows, but after this event the compositor no longer references it and the protocol provides no request to associate an existing rectangle with a new activation token. A client therefore cannot perform the advertised reuse; it must create a new rectangle instead.

**Triggers:** When a client receives `closed` and attempts to reuse the rectangle for another activation.

**Suggested fix:** Remove the reuse claim, or add an explicit request that associates an existing rectangle with a new activation token.
</issue_to_address>

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

Comment thread public/treeland-window-animation-unstable-v1.xml Outdated
@glyvut
glyvut force-pushed the feat/animation-new branch 3 times, most recently from fd4e355 to e575e23 Compare September 9, 2026 03:15
@glyvut
glyvut requested a review from wineee September 9, 2026 05:12
@glyvut
glyvut force-pushed the feat/animation-new branch from e575e23 to 7e35405 Compare September 9, 2026 06:16
@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

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

@glyvut
glyvut force-pushed the feat/animation-new branch 2 times, most recently from bbda448 to 7d85dbc Compare September 9, 2026 08:21
@deepin-bot

deepin-bot Bot commented Sep 10, 2026

Copy link
Copy Markdown

TAG Bot

New tag: 0.6.0
DISTRIBUTION: unstable
Suggest: synchronizing this PR through rebase #108

@glyvut
glyvut force-pushed the feat/animation-new branch 2 times, most recently from 3ac84a9 to a9c8e5a Compare September 14, 2026 09:16
@deepin-ci-robot

Copy link
Copy Markdown

deepin pr auto review

AI 代码审查报告

项目: linuxdeepin/treeland-protocols
PR: #94
标题: feat(protocol): add treeland-window-transition-unstable-v1 protocol
作者: glyvut
分支: feat/animation-new → master
审查时间: 2026-09-14 17:25:00
分析模式: 全量分析


总体评价

项目 结果
总分 100 / 100
评级 优秀
风险等级 None
审查结论 代码审查通过

未发现安全漏洞,代码结构清晰,文档完善,符合 Wayland 协议规范。新增协议设计合理,与现有协议风格一致。


漏洞统计

指标 数量
当前漏洞总数 0
新增漏洞 0
修复漏洞 0
持平漏洞 0

漏洞对比统计:新增漏洞 0 个,减少漏洞 0 个,持平 0 个


四维度评分

维度1:语法逻辑 ✓

项目 结果
评分 25 / 25
标记 ✓ 通过
评价 语法正确,逻辑清晰

分析内容

  • XML 文件格式正确,符合 Wayland 协议 XML schema 规范
  • 协议结构完整:copyright、description、interface、request、event、enum 定义齐全
  • 两个接口定义逻辑一致:treeland_window_transition_manager_v1(管理器)和 treeland_window_transition_rect_v1(矩形对象)
  • 请求参数类型正确(int、object、new_id),析构请求正确标记 type="destructor"
  • 错误枚举值连续递增(invalid_geometry=0, invalid_buffer=1)
  • 完整的11步协议流程说明,逻辑清晰无歧义
  • CMakeLists.txt 变更正确:在 TREELAND_PROTOCOL_XML_FILES 集合中新增文件引用,位置合理
  • README.md 和 README.zh_CN.md 变更内容与协议定义一致

问题列表:无


维度2:代码质量 ✓

项目 结果
评分 25 / 25
标记 ✓ 通过
评价 代码结构清晰,注释完整

分析内容

  • 协议描述极其详尽:包含完整11步交互流程、时序与责任说明、RFC 2119 合规声明
  • SPDX 版权和许可证信息完整(SPDX-FileCopyrightText: 2026 UnionTech Software Technology Co., Ltd., SPDX-License-Identifier: MIT)
  • 实验性警告清晰明确,与仓库其他协议文件风格一致
  • 中英文文档同步更新(README.md + README.zh_CN.md),翻译准确
  • 接口描述完整,每个请求和事件都有 summary 和详细说明
  • 无代码重复,无残留调试代码
  • 结构组织合理:管理器接口在前,矩形对象接口在后;请求在前,事件在后

问题列表:无


维度3:代码性能 ✓

项目 结果
评分 20 / 20
标记 ✓ 通过
评价 性能良好,资源使用合理

分析内容

  • 协议设计轻量:仅2个接口、5个请求、1个事件
  • 缓冲区处理遵循 Wayland 标准实践:合成器采样后发送 wl_buffer.release,客户端可在收到 release 后重用或销毁缓冲区
  • set_geometry 支持多次调用更新几何信息,这是设计需要而非性能问题
  • 协议本身不引入额外性能开销,转场动画由合成器实现

问题列表:无


维度4:代码安全 ✓

项目 结果
评分 30 / 30
标记 ✓ 通过
评价 存在0个安全漏洞

分析内容

  • 安全漏洞总数:0
  • 协议标记为 EXPERIMENTAL,明确无兼容性保证
  • 错误处理完善:定义了 invalid_geometry(几何无法处理)和 invalid_buffer(缓冲区无法导入)两种错误
  • 缓冲区处理遵循 Wayland 安全模型:合成器验证所有请求,客户端必须保持缓冲区有效直到收到 release
  • 支持 null 缓冲区清除源图像,设计安全
  • 无硬编码凭据,无注入风险
  • 协议遵循 Wayland 安全模型:所有请求由合成器验证

安全漏洞清单:无

漏洞对比统计:新增漏洞 0 个,减少漏洞 0 个,持平 0 个


文件变更分析

1. CMakeLists.txt(修改,+1 行)

TREELAND_PROTOCOL_XML_FILES 集合中新增 public/treeland-window-transition-unstable-v1.xml 文件引用。变更方式与现有协议文件注册方式完全一致,位置合理。

2. public/README.md(修改,+1 行)

在协议表格中新增一行,记录新协议的文件名、协议名、接口列表(treeland_window_transition_manager_v1, treeland_window_transition_rect_v1)和用途说明。描述准确,与协议定义一致。

3. public/README.zh_CN.md(修改,+1 行)

在中文协议表格中新增对应行,与英文版保持一致。翻译准确。

4. public/treeland-window-transition-unstable-v1.xml(新增,+204 行)

新增 Wayland 协议定义文件,定义窗口打开/关闭转场矩形协议。

协议结构

  • treeland_window_transition_manager_v1(version 1):管理器接口
    • destroy 请求(析构):销毁管理器
    • get_window_transition_rect 请求:创建转场矩形对象,关联到 xdg_activation_token_v1
  • treeland_window_transition_rect_v1(version 1):矩形对象接口
    • error 枚举:invalid_geometry(0)、invalid_buffer(1)
    • destroy 请求(析构):销毁矩形对象
    • set_geometry 请求:设置矩形几何(x, y, width, height),支持多次调用
    • set_source_buffer 请求:设置源图像(wl_buffer),支持 null 清除
    • closed 事件:通知矩形不再被使用

设计亮点

  • 详尽的11步交互流程说明
  • 明确的时序与责任要求
  • 完善的错误处理机制
  • 标准的 Wayland 缓冲区管理语义
  • RFC 2119 规范用语

合规检查

检查项 结果
命名规范
版权与许可证
实验性警告
文档完整性
错误处理
缓冲区管理

审查结论

本次提交新增 treeland-window-transition-unstable-v1 协议,为应用开发者提供基于 xdg-activation 令牌的窗口转场矩形关联能力。代码与 commit message 目的完全一致——新增窗口打开/关闭转场协议。协议设计合理,文档详尽,与仓库现有协议风格一致,未发现任何安全漏洞或质量问题。代码审查通过。

Add a new protocol for window open/close transitions relative to a
rectangle attached to an xdg-activation token.

新增窗口打开/关闭转场协议,转场矩形关联到 xdg-activation token。

Log: 新增treeland-window-transition-unstable-v1协议
Influence: 新增公开协议,为应用开发者提供基于xdg-activation令牌的窗口转场矩形关联能力。
@wineee
wineee added this pull request to the merge queue Sep 15, 2026
Merged via the queue into linuxdeepin:master with commit eb970e6 Sep 15, 2026
4 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