feat(protocol): add treeland-window-animation-v1 protocol - #94
Conversation
|
Skipping CI for Draft Pull Request. |
Reviewer's GuideAdds 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 animationsequenceDiagram
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
State diagram for persistent window animation rectanglestateDiagram-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 --> [*]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
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.
0ef59fd to
289a095
Compare
There was a problem hiding this comment.
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>fd4e355 to
e575e23
Compare
e575e23 to
7e35405
Compare
|
[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. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
bbda448 to
7d85dbc
Compare
|
TAG Bot New tag: 0.6.0 |
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令牌的窗口转场矩形关联能力。
7d85dbc to
3ac84a9
Compare
Persistent, updatable rect object for window open/close animation:
Summary by Sourcery
Add an experimental protocol for configurable window open and close transitions tied to activation tokens.
New Features:
Enhancements:
Build:
Documentation: