Skip to content

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

Open
glyvut wants to merge 1 commit into
linuxdeepin:masterfrom
glyvut:feat/animation-new
Open

feat(protocol): add treeland-window-animation-v1 protocol#94
glyvut wants to merge 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

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令牌的窗口转场矩形关联能力。
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