feat(protocol): add treeland-window-animation-v1 protocol - #94
Conversation
|
Skipping CI for Draft Pull Request. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: glyvut The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Reviewer's GuideIntroduces the experimental treeland-window-animation-v1 Wayland protocol, replacing the one-shot launch-animation model with a persistent, repeatedly updatable rectangle associated with an activation token; the protocol defines geometry validation, close-event lifecycle, and default-animation fallback when the rectangle is destroyed. Sequence diagram for persistent window animation rectangle lifecyclesequenceDiagram
participant A as AppA
participant M as AnimationManager
participant R as AnimationRect
participant T as ActivationToken
participant B as AppB
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, surface)
C->>C: Play open animation from latest rectangle
A->>R: set_geometry(new_x, new_y, new_width, new_height)
A->>R: commit()
B->>C: Close target window
C->>C: Play close animation to latest rectangle
C-->>R: closed
A->>R: destroy()
State diagram for window animation rectangle lifecyclestateDiagram-v2
[*] --> Uncommitted
Uncommitted --> Committed: set_geometry() + commit()
Committed --> Committed: set_geometry() + commit()
Committed --> Closed: target window destroyed
Closed --> [*]: destroy()
Committed --> DefaultClose: destroy() / client disconnect / origin surface destroyed
DefaultClose --> [*]
Uncommitted --> Uncommitted: commit() / no_geometry error
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
d492ee3 to
91ef201
Compare
Add a new protocol for window open/close animations relative to a rectangle attached to an xdg-activation token. 新增窗口打开/关闭动画协议,动画矩形关联到 xdg-activation token。 Log: 新增treeland-window-animation-v1协议 Influence: 新增公开协议,为应用开发者提供基于xdg-activation令牌的窗口动画矩形关联能力。
91ef201 to
6bb52fd
Compare
There was a problem hiding this comment.
🟡 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-v1protocol with manager + rect interfaces, geometry/commit workflow, optionalwl_buffersource image, and aclosedevent. - Registers the new protocol in the public protocols README table.
- Adds the protocol XML to
TREELAND_PROTOCOL_XML_FILESfor 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, theclosedevent appears beforeset_geometry/commit/set_source_buffer, and theerrorenum 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
closedevent 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.
| set(TREELAND_PROTOCOL_XML_FILES | ||
| public/treeland-dde-shell-v1.xml | ||
| public/treeland-window-animation-v1.xml | ||
| ) |
|
|
||
| | File | Protocol | Interfaces | Purpose | | ||
| |------|----------|-----------|---------| | ||
| | `treeland-window-animation-v1.xml` | `treeland_window_animation_v1` | `treeland_window_animation_manager_v1`, `treeland_window_animation_rect_v1` | Window open/close animation relative to a rectangle, with optional source image | |
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <protocol name="treeland_window_animation_v1"> |
Persistent, updatable rect object for window open/close animation:
Summary by Sourcery
Add a persistent, updatable window animation protocol for activation-driven open and close transitions.
New Features:
Enhancements:
Build:
Documentation: