Skip to content

feat(launch-animation): play launch animation from a specified rect - #1298

Draft
deepin-wm wants to merge 1 commit into
linuxdeepin:masterfrom
deepin-wm:feat/launch-animation-v1
Draft

feat(launch-animation): play launch animation from a specified rect#1298
deepin-wm wants to merge 1 commit into
linuxdeepin:masterfrom
deepin-wm:feat/launch-animation-v1

Conversation

@deepin-wm

@deepin-wm deepin-wm commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

What

在 treeland 侧实现启动动画:新增 launch-animation 服务端模块,集成至 xdg-activation token 流程,使合成器可从客户端指定的矩形区域播放启动动画。含 sender/receiver demo。

Changes

  • src/modules/launch-animation/ — 新模块,服务端协议实现(LaunchAnimationManagerInterfaceV1,管理矩形对象,按 token resource 索引已 commit 矩形)
  • src/modules/activation/activationmanagerinterfacev1.{h,cpp} — 新增 setLaunchRectProvider() 回调;TokenInfo 增加 originatingSurface/launchRectactivate() 在有 launch rect 时允许 unmapped surface;activateRequested 扩展为携带 originatingSurface 与 launchRect;一次性 token 语义
  • src/seat/helper.{h,cpp} — 创建 LaunchAnimationManager,设置 provider,在 activateRequested 中换算全局矩形并存入目标 SurfaceWrapper
  • src/surface/surfacewrapper.{h,cpp} — 新增 m_launchAnimationRectcreateNewOrClose() 在有 launch rect 时使用 GeometryAnimation
  • src/common/treelandlogging.{h,cpp} — 新增 launchAnimation 日志分类
  • examples/test_launch_animation/ — demo:sender 显示图片按空格启动 receiver,receiver 全屏显示图片并请求动画

依赖

Related

Summary by Sourcery

Implement client-specified launch animations throughout activation handling, surface mapping, and compositor presentation.

New Features:

  • Add a server-side launch-animation protocol that lets clients associate a source rectangle with an xdg activation token.
  • Play launch animations for newly mapped surfaces from the client-specified source rectangle to the target window geometry.
  • Provide sender and receiver demo applications for exercising launch animations. وم

Bug Fixes:

  • Allow activation requests for unmapped surfaces when a valid launch rectangle is present while preserving one-shot token behavior.
  • Discard stale or invalid launch rectangles when their originating or target surface is unavailable or mapped too late.

Enhancements:

  • Extend activation handling with originating-surface and launch-rectangle context and global-coordinate mapping.
  • Integrate launch animation lifecycle handling with surface readiness, layout settling, invalidation, and existing window animation settings.
  • Add dedicated launch-animation logging and build integration for the new module, QML animation, and example.

Build:

  • Add the launch-animation server module, protocol generation, QML animation resource, and example target to the build.

@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

@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: deepin-wm

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

@sourcery-ai

sourcery-ai Bot commented Aug 18, 2026

Copy link
Copy Markdown

Reviewer's Guide

Implements a new server-side treeland launch-animation module and wires it into the xdg-activation flow so the compositor can play a window open animation from a client-specified rectangle; extends activation token handling to carry originating surfaces and launch rectangles, propagates them through Helper into SurfaceWrapper to drive GeometryAnimation, adds logging and CMake wiring, and provides a sender/receiver demo example.

Sequence diagram for launch animation via activation token

sequenceDiagram
    actor Client
    participant LaunchAnimationManagerInterfaceV1 as LaunchAnimationManager
    participant ActivationManagerInterfaceV1 as ActivationManager
    participant Helper
    participant SurfaceWrapper

    Client->>LaunchAnimationManager: treeland_launch_animation_manager_v1.get_launch_rect
    LaunchAnimationManager->>Client: treeland_launch_rect_v1
    Client->>LaunchAnimationManager: treeland_launch_rect_v1.set_geometry
    Client->>LaunchAnimationManager: treeland_launch_rect_v1.commit
    LaunchAnimationManager->>LaunchAnimationManager: m_committedRects.insert(tokenResource, rect)

    Client->>ActivationManager: xdg_activation_token_v1.commit
    ActivationManager->>ActivationManager: launchRectProvider(tokenResourceHandle)
    ActivationManager->>LaunchAnimationManager: takeCommittedRect(tokenResource)
    LaunchAnimationManager-->>ActivationManager: std_optional_QRectF
    ActivationManager->>ActivationManager: registerToken(appId, client, serial, activate, originatingSurface, launchRect)

    Client->>ActivationManager: xdg_activation_v1.activate
    ActivationManager->>ActivationManager: find token -> disposition, originatingSurface, launchRect
    ActivationManager-->>Helper: activateRequested(disposition, wsurface, originatingSurface, launchRect)

    Helper->>SurfaceWrapper: setLaunchAnimationRect(globalRect)

    alt surface maps and launch rect valid
        SurfaceWrapper->>SurfaceWrapper: createNewOrClose(OPEN_ANIMATION)
        SurfaceWrapper->>SurfaceWrapper: m_engine.createGeometryAnimation(fromGeometry, toGeometry)
        SurfaceWrapper-->>SurfaceWrapper: onLaunchAnimationFinished
    end
Loading

File-Level Changes

Change Details Files
Extend activation tokens to carry originating surface and launch-rectangle metadata and emit them via activateRequested.
  • Add originatingSurface and launchRect fields to TokenInfo and store them when registering tokens.
  • Introduce LaunchRectProvider callback in ActivationManagerInterfaceV1 and invoke it at token commit to fetch a committed launch rect per token resource.
  • Refactor activate() to resolve disposition, originatingSurface, and launchRect in one pass, enforce one-shot semantics even on failure, and emit activateRequested with the extra parameters while allowing unmapped surfaces when a launch rect exists.
src/modules/activation/activationmanagerinterfacev1.h
src/modules/activation/activationmanagerinterfacev1.cpp
Add a launch-animation Wayland server module to cache committed launch rectangles keyed by xdg_activation_token_v1 resources.
  • Implement treeland_launch_animation_manager_v1 and treeland_launch_rect_v1 handlers that validate geometry, enforce single commit, and cache committed QRectF per token wl_resource.
  • Track token resource destruction via wl_listeners to drop stale cache entries and prevent dangling wl_resource* keys.
  • Expose takeCommittedRect() API on LaunchAnimationManagerInterfaceV1 for activation manager consumption and wire the module into the modules CMake build.
src/modules/launch-animation/launchanimationmanagerinterfacev1.h
src/modules/launch-animation/launchanimationmanagerinterfacev1.cpp
src/modules/launch-animation/CMakeLists.txt
src/modules/CMakeLists.txt
Plumb launch rectangles through Helper into SurfaceWrapper and play launch animations using GeometryAnimation from the specified rect.
  • Attach LaunchAnimationManagerInterfaceV1 in Helper, set the activation manager's LaunchRectProvider to consume committed rects per token resource, and extend the activateRequested lambda to convert local rects from the originating surface into global coordinates and store them on the target wrapper.
  • Allow activation requests for unmapped surfaces when a launch rect is present, deferring activation until map while optionally setting attention state.
  • Add m_launchAnimationRect field, setter, and onLaunchAnimationFinished() in SurfaceWrapper; have createNewOrClose() prefer a GeometryAnimation from m_launchAnimationRect when direction is OPEN_ANIMATION, replacing any existing animation when needed.
src/seat/helper.h
src/seat/helper.cpp
src/surface/surfacewrapper.h
src/surface/surfacewrapper.cpp
Introduce logging and an example client to exercise launch animation via xdg-activation and the new treeland-launch-animation-v1 protocol.
  • Add treelandLaunchAnimation logging category for the new module.
  • Add a test_launch_animation example: a sender window that requests an activation token, attaches a launch rect for an image widget, and launches a receiver process; the receiver activates itself with the token before mapping so the compositor can play the launch animation.
  • Wire the example into the examples CMake build and generate client protocol bindings for xdg-activation and treeland-launch-animation-v1.
src/common/treelandlogging.h
src/common/treelandlogging.cpp
examples/test_launch_animation/main.cpp
examples/test_launch_animation/CMakeLists.txt
examples/CMakeLists.txt

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

@deepin-wm
deepin-wm force-pushed the feat/launch-animation-v1 branch from a97d42b to d2ac94b Compare August 18, 2026 13:06
@deepin-wm deepin-wm changed the title feat(launch-animation): play launch animation from a specified rect (DRAFT, needs rebase) feat(launch-animation): play launch animation from a specified rect Aug 18, 2026
@deepin-wm
deepin-wm force-pushed the feat/launch-animation-v1 branch 5 times, most recently from 4af5f35 to 4bf9a95 Compare August 20, 2026 02:08
Add a server-side launch-animation module and integrate it with the
activation token flow so the compositor plays a launch animation
originating from a client-specified rectangle.

The launch rect is in surface-local coordinates (relative to the
originating WSurface content). Use WSurfaceItem::mapFromSurface() to
convert it into the wrapper coordinate space (accounting for title-bar
and decoration padding) before adding the wrapper's global position.

The target geometry is sampled only after WSurfaceItem::readyChanged
fires and one event-loop iteration later, so the layout chain
(widthChanged → arrangeNonLayerSurface → setPosition) has settled and
position()/size() are no longer stale.

新增启动动画模块并集成至 activation token 流程:合成器在收到带
launch rect 的 activate 请求时,结合发起方 surface 位置换算全局
矩形,从该区域播放启动动画。含 sender/receiver demo 示例。

Log: 实现启动动画从指定矩形区域过渡画出
Influence: 应用启动时可从发起方指定矩形区域过渡画出启动动画。
@deepin-wm
deepin-wm force-pushed the feat/launch-animation-v1 branch from 4bf9a95 to dde6d37 Compare August 20, 2026 06:33
@deepin-bot

deepin-bot Bot commented Aug 21, 2026

Copy link
Copy Markdown

TAG Bot

New tag: 0.9.0
DISTRIBUTION: unstable
Suggest: synchronizing this PR through rebase #1312

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.

3 participants