feat(window-transition): implement window transition protocol - #1394
feat(window-transition): implement window transition protocol#1394glyvut wants to merge 1 commit into
Conversation
Reviewer's GuideImplements activation-token-based window transitions end to end: clients attach persistent source rectangles and optional images, the compositor associates them with activated windows, and QML-rendered open/close animations use live source geometry with lifecycle-safe fallback and cleanup. Sequence diagram for activation-token window transitionsequenceDiagram
participant Client
participant ActivationManager
participant TransitionManager
participant SurfaceWrapper
participant WindowTransition
Client->>TransitionManager: get_window_transition_rect(token)
Client->>TransitionManager: set_geometry(x,y,width,height)
Client->>TransitionManager: set_source_buffer(buffer)
Client->>ActivationManager: commit()
ActivationManager->>TransitionManager: takeCommittedRect(token, tokenResource)
Client->>ActivationManager: activate(token, targetSurface)
ActivationManager->>SurfaceWrapper: activateRequested(token, targetSurface, originatingSurface)
TransitionManager->>SurfaceWrapper: associatePendingRect(token, target, origin)
SurfaceWrapper->>SurfaceWrapper: setPendingActivation(seat)
SurfaceWrapper->>WindowTransition: createWindowTransition(fromRect, toRect, sourceBuffer)
WindowTransition-->>SurfaceWrapper: finished()
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
c610a59 to
033c530
Compare
|
[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 |
There was a problem hiding this comment.
Hey - I've found 2 issues
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="src/modules/activation/activationmanagerinterfacev1.cpp" line_range="231-251" />
<code_context>
auto it = std::find_if(m_tokens.begin(), m_tokens.end(),
</code_context>
<issue_to_address>
**issue (bug_risk):** Expired activation tokens are accepted because the new single-pass lookup computes disposition without checking `it->expiry.hasExpired()`. A token can therefore still activate a window after the intended 60-second lifetime.
**Triggers:** When a client waits until the activation token has expired before calling activate.
**Suggested fix:** Reject the token and use `Invalid` disposition when `it->expiry.hasExpired()` is true.
</issue_to_address>
### Comment 2
<location path="examples/test-window-transition/CMakeLists.txt" line_range="21-28" />
<code_context>
+ Qt6::Gui
+ Qt6::Widgets
+ Qt6::WaylandClient
+ Qt6::GuiPrivate
+ Qt6::WaylandClientPrivate
+)
+
+install(TARGETS ${BIN_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
</code_context>
<issue_to_address>
**issue (bug_risk):** The example links `Qt6::GuiPrivate` and `Qt6::WaylandClientPrivate` unconditionally, although those components are only found when Qt is at least 6.10. With an older supported Qt version, CMake cannot resolve these imported targets and configuration fails.
**Triggers:** When building the examples with Qt older than 6.10.
**Suggested fix:** Only link the private Qt targets in the same Qt-version conditional, or require Qt 6.10 for this example.
```suggestion
target_link_libraries(${BIN_NAME}
PRIVATE
Qt6::Gui
Qt6::Widgets
Qt6::WaylandClient
)
if(Qt6_VERSION VERSION_GREATER_EQUAL 6.10)
target_link_libraries(${BIN_NAME}
PRIVATE
Qt6::GuiPrivate
Qt6::WaylandClientPrivate
)
endif()
```
</issue_to_address>| target_link_libraries(${BIN_NAME} | ||
| PRIVATE | ||
| Qt6::Gui | ||
| Qt6::Widgets | ||
| Qt6::WaylandClient | ||
| Qt6::GuiPrivate | ||
| Qt6::WaylandClientPrivate | ||
| ) |
There was a problem hiding this comment.
issue (bug_risk): The example links Qt6::GuiPrivate and Qt6::WaylandClientPrivate unconditionally, although those components are only found when Qt is at least 6.10. With an older supported Qt version, CMake cannot resolve these imported targets and configuration fails.
Triggers: When building the examples with Qt older than 6.10.
Suggested fix: Only link the private Qt targets in the same Qt-version conditional, or require Qt 6.10 for this example.
| target_link_libraries(${BIN_NAME} | |
| PRIVATE | |
| Qt6::Gui | |
| Qt6::Widgets | |
| Qt6::WaylandClient | |
| Qt6::GuiPrivate | |
| Qt6::WaylandClientPrivate | |
| ) | |
| target_link_libraries(${BIN_NAME} | |
| PRIVATE | |
| Qt6::Gui | |
| Qt6::Widgets | |
| Qt6::WaylandClient | |
| ) | |
| if(Qt6_VERSION VERSION_GREATER_EQUAL 6.10) | |
| target_link_libraries(${BIN_NAME} | |
| PRIVATE | |
| Qt6::GuiPrivate | |
| Qt6::WaylandClientPrivate | |
| ) | |
| endif() |
Add the server-side implementation of treeland-window-transition-unstable-v1, which plays a window open/close transition relative to a source rectangle attached to an xdg-activation token. A client attaches a persistent transition rectangle (geometry plus an optional source image) to an xdg_activation_token_v1 before committing the token. At activation the compositor associates the rectangle with the target window, animating from the rectangle's global position on open and back to it on close. The rectangle stays alive, so set_geometry and set_source_buffer update it immediately. 新增 treeland-window-transition-unstable-v1 的服务端实现,基于关联到 xdg-activation token 的源矩形播放窗口打开/关闭转场。 客户端在提交 token 前挂载一个持久的转场矩形(几何信息及可选源图像)。 激活时合成器将矩形关联到目标窗口,打开时从矩形的全局位置播放动画, 关闭时过渡回该矩形。矩形持续存活,set_geometry / set_source_buffer 可立即更新。 Log: 实现窗口转场协议,基于激活 token 的源矩形播放开/关转场 Influence: 新增窗口转场模块、QML 动画组件及 test-window-transition 样例; 激活流程支持矩形关联并播放开/关动画。
033c530 to
59102fe
Compare
Add the server-side implementation of treeland-window-transition-unstable-v1, which plays a window open/close transition relative to a source rectangle attached to an xdg-activation token.
A client attaches a persistent transition rectangle (geometry plus an optional source image) to an xdg_activation_token_v1 before committing the token. At activation the compositor associates the rectangle with the target window, animating from the rectangle's global position on open and back to it on close. The rectangle stays alive, so set_geometry and set_source_buffer update it immediately.
新增 treeland-window-transition-unstable-v1 的服务端实现,基于关联到 xdg-activation token 的源矩形播放窗口打开/关闭转场。
客户端在提交 token 前挂载一个持久的转场矩形(几何信息及可选源图像)。
激活时合成器将矩形关联到目标窗口,打开时从矩形的全局位置播放动画,
关闭时过渡回该矩形。矩形持续存活,set_geometry / set_source_buffer
可立即更新。
Log: 实现窗口转场协议,基于激活 token 的源矩形播放开/关转场
Influence: 新增窗口转场模块、QML 动画组件及 test-window-transition 样例; 激活流程支持矩形关联并播放开/关动画。
Summary by Sourcery
Implement activation-token-based window transitions from a persistent source rectangle, including compositor integration, animations, lifecycle management, and an example client.
New Features:
Enhancements:
Build:
Tests:
Chores: