Conversation
Change get_window_transition_rect to accept the committed activation token string instead of an xdg_activation_token_v1 object, so the client no longer needs to hold the token object to create the rect. 将 get_window_transition_rect 改为接收已提交的激活令牌字符串, 不再接收 xdg_activation_token_v1 对象,客户端无需持有令牌对象 即可创建转场矩形。 Log: 转场矩形改用令牌字符串关联 PMS: TASK-395857 Influence: 客户端需在提交令牌后再调用 get_window_transition_rect; 矩形不再要求在令牌提交前创建
Reviewer's GuideThe protocol documentation now associates window transition rectangles with committed activation token strings, allowing clients to release the token object before creating the rectangle and shifting rectangle creation until after token commitment. Sequence diagram for committed activation token transition setupsequenceDiagram
participant A as OriginatingSurface
participant M as TransitionManager
participant T as ActivationToken
participant B as TargetWindow
participant C as Compositor
A->>T: set_surface
A->>T: commit
T-->>A: token string
A->>M: get_window_transition_rect(token string)
M-->>A: rect object
A->>A: set_geometry
A->>B: pass token string
B->>C: xdg_activation_v1.activate(token string, surface)
C->>C: look up rectangle by token string
C-->>B: play open transition
Sequence diagram for live transition rectangle updates and close animationsequenceDiagram
participant A as OriginatingSurface
participant R as TransitionRect
participant B as TargetWindow
participant C as Compositor
A->>R: set_geometry
A->>R: set_source_surface
A->>R: set_geometry
B->>C: close
C->>R: use latest geometry
C-->>B: play close transition to rectangle
C-->>A: closed
A->>R: destroy
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
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-transition-unstable-v1.xml" line_range="50-51" />
<code_context>
- 1. A, the originating surface, obtains an xdg_activation_token_v1
- and calls set_surface to identify itself.
+ 1. A, the originating surface, obtains an xdg_activation_token_v1,
+ calls set_surface to identify itself, and calls commit to obtain
+ the token string.
2. A calls get_window_transition_rect on this manager, passing the
- token.
</code_context>
<issue_to_address>
**issue:** The documented flow says that A calls `commit` to obtain the token string, but the xdg-activation protocol delivers that string asynchronously in the token object's `done` event. A client following this sequence has no documented point at which it should wait before calling `get_window_transition_rect`, so it can attempt the request before a token string exists.
**Triggers:** When a client follows the numbered flow literally and issues the rectangle request immediately after sending `commit`.
**Suggested fix:** State that A must wait for the xdg activation token object's `done` event and use the token string carried by that event before calling `get_window_transition_rect`.
</issue_to_address>| calls set_surface to identify itself, and calls commit to obtain | ||
| the token string. |
There was a problem hiding this comment.
issue: The documented flow says that A calls commit to obtain the token string, but the xdg-activation protocol delivers that string asynchronously in the token object's done event. A client following this sequence has no documented point at which it should wait before calling get_window_transition_rect, so it can attempt the request before a token string exists.
Triggers: When a client follows the numbered flow literally and issues the rectangle request immediately after sending commit.
Suggested fix: State that A must wait for the xdg activation token object's done event and use the token string carried by that event before calling get_window_transition_rect.
|
[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 |
deepin pr auto review🤖 AI 代码审查报告📊 总体评价
🔍 详细分析1. 语法逻辑 ✅评价: 优秀 ✅ 通过 潜在问题: 建议: XML 语法正确,Wayland 协议定义规范。type="string" 是合法的 Wayland 协议参数类型。流程重排序逻辑合理:先 commit 获取令牌字符串,再调用 get_window_transition_rect 传入字符串,与新的接口定义一致。 2. 代码质量 ✅评价: 优秀 ✅ 通过 潜在问题: 建议: 文档描述完整且一致,所有引用 token 的位置均已从 object 更新为 string。协议流程步骤从 11 步精简为 10 步,编号连续无遗漏。description 标签内容准确描述了接口用途和使用方式。 3. 代码性能 ✅评价: 优秀 ✅ 通过 潜在问题: 建议: 协议定义文件无运行时性能影响。使用字符串替代对象引用简化了客户端实现,客户端无需持有令牌对象即可创建转场矩形,降低了资源管理复杂度。 4. 代码安全 🔒评价: 优秀 ✅ 通过
安全漏洞详情: 建议: 存在0个安全漏洞。本次变更为协议定义层面的接口重构,不涉及用户输入处理、凭证管理或权限控制。令牌字符串仍通过 xdg_activation 协议的 commit 机制获取,安全性由协议实现层保障。 💡 改进建议代码示例// 本次变更为 Wayland 协议定义文件重构,代码质量优秀,无需修改
// get_window_transition_rect 接口变更前:
// <arg name="token" type="object" interface="xdg_activation_token_v1" .../>
// 变更后:
// <arg name="token" type="string" .../>
// 接口设计合理,文档完整,无需额外改进本报告由 AI 代码审查工具自动生成 |
Change get_window_transition_rect to accept the committed activation token string instead of an xdg_activation_token_v1 object, so the client no longer needs to hold the token object to create the rect.
将 get_window_transition_rect 改为接收已提交的激活令牌字符串,
不再接收 xdg_activation_token_v1 对象,客户端无需持有令牌对象
即可创建转场矩形。
Log: 转场矩形改用令牌字符串关联
PMS: TASK-395857
Influence: 客户端需在提交令牌后再调用 get_window_transition_rect; 矩形不再要求在令牌提交前创建
Summary by Sourcery
Associate window transition rectangles with committed activation token strings instead of token objects.
Enhancements:
Documentation: