Skip to content

feat: add smooth animation for prelaunch splash transition#813

Draft
wineee wants to merge 9 commits intolinuxdeepin:masterfrom
wineee:splash
Draft

feat: add smooth animation for prelaunch splash transition#813
wineee wants to merge 9 commits intolinuxdeepin:masterfrom
wineee:splash

Conversation

@wineee
Copy link
Copy Markdown
Member

@wineee wineee commented Mar 31, 2026

Added smooth geometry animation when transitioning from prelaunch splash to main surface content. Previously, the size change was abrupt when the prelaunch splash was destroyed. Now, when there's a significant size difference between the current implicit size and the target surface size, a smooth animation is applied to provide better visual experience.

The implementation includes:

  1. Added size comparison to detect when animation is needed
  2. Created geometry animation using the animation engine
  3. Added new slots to handle animation ready and finished events
  4. Stored pending implicit size for animation completion
  5. Used Q_ASSERT for connection verification

Log: Added smooth transition animation when closing prelaunch splash screen

Influence:

  1. Test prelaunch splash with various surface sizes
  2. Verify smooth animation when splash is destroyed
  3. Check that connections are properly established
  4. Test edge cases with same size transitions
  5. Verify animation cleanup after completion
  6. Test with different window states and geometries

feat: 为预启动闪屏过渡添加平滑动画

在从预启动闪屏过渡到主表面内容时添加了平滑的几何动画。之前当预启动闪屏
被销毁时,尺寸变化是突兀的。现在当当前隐式尺寸与目标表面尺寸存在显著差异
时,会应用平滑动画以提供更好的视觉体验。

实现包括:

  1. 添加尺寸比较以检测何时需要动画
  2. 使用动画引擎创建几何动画
  3. 添加新的槽函数处理动画准备和完成事件
  4. 存储待处理的隐式尺寸用于动画完成
  5. 使用 Q_ASSERT 进行连接验证

Log: 关闭预启动闪屏时添加平滑过渡动画

Influence:

  1. 测试不同表面尺寸的预启动闪屏
  2. 验证闪屏销毁时的平滑动画效果
  3. 检查连接是否正确建立
  4. 测试相同尺寸过渡的边缘情况
  5. 验证动画完成后的清理工作
  6. 测试不同窗口状态和几何形状

Summary by Sourcery

Add a smooth geometry-based transition when closing the prelaunch splash and handing over to the main surface content.

New Features:

  • Introduce size-difference detection to decide when to animate the transition from prelaunch splash to the main surface.
  • Add a geometry animation for the prelaunch-to-main surface handoff using the existing animation engine.

Enhancements:

  • Defer binding of the main surface implicit size until the prelaunch transition animation is ready, ensuring a visually consistent resize.
  • Add dedicated slots and internal state to manage prelaunch geometry animation lifecycle and cleanup safely.

Added smooth geometry animation when transitioning from prelaunch splash
to main surface content. Previously, the size change was abrupt when
the prelaunch splash was destroyed. Now, when there's a significant
size difference between the current implicit size and the target surface
size, a smooth animation is applied to provide better visual experience.

The implementation includes:
1. Added size comparison to detect when animation is needed
2. Created geometry animation using the animation engine
3. Added new slots to handle animation ready and finished events
4. Stored pending implicit size for animation completion
5. Used Q_ASSERT for connection verification

Log: Added smooth transition animation when closing prelaunch splash
screen

Influence:
1. Test prelaunch splash with various surface sizes
2. Verify smooth animation when splash is destroyed
3. Check that connections are properly established
4. Test edge cases with same size transitions
5. Verify animation cleanup after completion
6. Test with different window states and geometries

feat: 为预启动闪屏过渡添加平滑动画

在从预启动闪屏过渡到主表面内容时添加了平滑的几何动画。之前当预启动闪屏
被销毁时,尺寸变化是突兀的。现在当当前隐式尺寸与目标表面尺寸存在显著差异
时,会应用平滑动画以提供更好的视觉体验。

实现包括:
1. 添加尺寸比较以检测何时需要动画
2. 使用动画引擎创建几何动画
3. 添加新的槽函数处理动画准备和完成事件
4. 存储待处理的隐式尺寸用于动画完成
5. 使用 Q_ASSERT 进行连接验证

Log: 关闭预启动闪屏时添加平滑过渡动画

Influence:
1. 测试不同表面尺寸的预启动闪屏
2. 验证闪屏销毁时的平滑动画效果
3. 检查连接是否正确建立
4. 测试相同尺寸过渡的边缘情况
5. 验证动画完成后的清理工作
6. 测试不同窗口状态和几何形状
@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: wineee

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
Copy link
Copy Markdown

sourcery-ai bot commented Mar 31, 2026

Reviewer's Guide

Implements a conditional geometry animation when destroying the prelaunch splash so that the SurfaceWrapper’s implicit size transitions smoothly to the main surface’s implicit size, wiring it into the existing animation engine and cleaning up the animation afterwards.

Sequence diagram for prelaunch splash destroy with conditional geometry animation

sequenceDiagram
    actor User
    participant SurfaceWrapper
    participant WSurfaceItem
    participant AnimationEngine as AnimationEngine
    participant GeometryAnimation as GeometryAnimation
    participant Container as Container

    User->>SurfaceWrapper: onPrelaunchSplashDestroyRequested()
    activate SurfaceWrapper
    SurfaceWrapper->>WSurfaceItem: read implicitWidth(), implicitHeight()
    SurfaceWrapper->>SurfaceWrapper: compute targetImplicitSize
    SurfaceWrapper->>SurfaceWrapper: compare implicitSize vs targetImplicitSize
    alt needImplicitSizeTransition and no m_geometryAnimation and container exists
        SurfaceWrapper->>SurfaceWrapper: store m_pendingPrelaunchImplicitSize
        SurfaceWrapper->>AnimationEngine: createGeometryAnimation(this, fromGeometry, toGeometry, container)
        AnimationEngine-->>SurfaceWrapper: m_geometryAnimation
        SurfaceWrapper->>GeometryAnimation: connect(ready, onPrelaunchGeometryAnimationReady)
        SurfaceWrapper->>GeometryAnimation: connect(finished, onPrelaunchGeometryAnimationFinished)
        SurfaceWrapper->>GeometryAnimation: invokeMethod(start)
        GeometryAnimation-->>SurfaceWrapper: ready()
        activate GeometryAnimation
        SurfaceWrapper->>SurfaceWrapper: onPrelaunchGeometryAnimationReady()
        SurfaceWrapper->>WSurfaceItem: connect implicitWidthChanged/implicitHeightChanged
        SurfaceWrapper->>WSurfaceItem: connect boundingRectChanged
        SurfaceWrapper->>SurfaceWrapper: setImplicitSize(m_pendingPrelaunchImplicitSize)
        GeometryAnimation-->>SurfaceWrapper: finished()
        SurfaceWrapper->>SurfaceWrapper: onPrelaunchGeometryAnimationFinished()
        SurfaceWrapper->>GeometryAnimation: disconnect(this)
        SurfaceWrapper->>GeometryAnimation: deleteLater()
        SurfaceWrapper->>SurfaceWrapper: m_geometryAnimation = nullptr
        deactivate GeometryAnimation
    else no implicit size transition needed
        SurfaceWrapper->>WSurfaceItem: connect implicitWidthChanged/implicitHeightChanged
        SurfaceWrapper->>WSurfaceItem: connect boundingRectChanged
        SurfaceWrapper->>SurfaceWrapper: setImplicitSize(targetImplicitSize)
    end
    SurfaceWrapper->>SurfaceWrapper: updateVisible()
    SurfaceWrapper-->>User: prelaunchSplashChanged()
    deactivate SurfaceWrapper
Loading

Updated class diagram for SurfaceWrapper prelaunch animation handling

classDiagram
    class SurfaceWrapper {
        // Members
        QPointer~QQuickItem~ m_coverContent
        QPointer~QQuickItem~ m_prelaunchSplash
        QList~WOutput*~ m_prelaunchOutputs
        QSizeF m_pendingPrelaunchImplicitSize
        QRectF m_boundedRect
        QRectF m_normalGeometry
        QRectF m_maximizedGeometry
        QObject* m_geometryAnimation
        AnimationEngine* m_engine

        // Slots
        void onPrelaunchSplashDestroyRequested()
        void onPrelaunchGeometryAnimationReady()
        void onPrelaunchGeometryAnimationFinished()
        bool startStateChangeAnimation(State targetState, const QRectF &targetGeometry)
        void onAnimationReady()
        void onAnimationFinished()
        void onWindowAnimationFinished()
        void onShowAnimationFinished()
    }

    class WSurfaceItem {
        qreal implicitWidth()
        qreal implicitHeight()
        signal implicitWidthChanged()
        signal implicitHeightChanged()
        signal boundingRectChanged()
    }

    class GeometryAnimation {
        signal ready()
        signal finished()
        void start()
        void deleteLater()
        void disconnect(QObject* object)
    }

    class AnimationEngine {
        GeometryAnimation* createGeometryAnimation(QObject* target, QRectF fromGeometry, QRectF toGeometry, QObject* container)
    }

    class QQuickItem {
    }

    class WOutput {
    }

    SurfaceWrapper --> WSurfaceItem : uses m_surfaceItem
    SurfaceWrapper --> QQuickItem : uses container()
    SurfaceWrapper --> WOutput : manages m_prelaunchOutputs
    SurfaceWrapper --> GeometryAnimation : manages m_geometryAnimation
    SurfaceWrapper --> AnimationEngine : uses m_engine
    GeometryAnimation --> SurfaceWrapper : emits ready, finished signals to slots
    WSurfaceItem --> SurfaceWrapper : emits implicitWidthChanged implicitHeightChanged boundingRectChanged to SurfaceWrapper
Loading

File-Level Changes

Change Details Files
Add conditional geometry animation for prelaunch splash destruction based on implicit size difference.
  • Compute target implicit size from the associated WSurfaceItem when the prelaunch splash destroy is requested.
  • Compare current implicit size with target size using qFuzzyCompare to decide if a transition animation is required.
  • Introduce a lambda to rebind implicit size/geometry and decoration stacking to the surface item when no animation is needed.
src/surface/surfacewrapper.cpp
Integrate geometry animation lifecycle (ready/finished) to drive a smooth size transition and ensure cleanup.
  • Create a geometry animation from current geometry to target implicit size via the animation engine when needed and a container is available.
  • Connect animation ready/finished signals to new slots using Q_ASSERT to validate successful connections and invoke the animation start method via QMetaObject::invokeMethod.
  • In the ready slot, apply the pending implicit size and re-establish bindings from the surface item, including bounding rect updates and decoration stacking.
  • In the finished slot, disconnect the animation from this object, schedule its deletion with deleteLater, and null the pointer to avoid dangling usage.
  • Store pending target implicit size in a new member to be used when the animation is ready.
src/surface/surfacewrapper.cpp
src/surface/surfacewrapper.h
Extend SurfaceWrapper state to support prelaunch geometry animation handling.
  • Declare new slots onPrelaunchGeometryAnimationReady and onPrelaunchGeometryAnimationFinished in the SurfaceWrapper class.
  • Add a QSizeF member m_pendingPrelaunchImplicitSize to cache the target size across the animation lifecycle.
  • Include qassert.h to use Q_ASSERT for debugging-time validation of signal-slot connections and method invocation.
src/surface/surfacewrapper.cpp
src/surface/surfacewrapper.h

Possibly linked issues

  • #TODO: splash screen: PR improves splash transition smoothness, addressing the issue’s screen jump/abrupt change problems in splash replacement

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

@wineee
Copy link
Copy Markdown
Member Author

wineee commented Mar 31, 2026

sudo rm -rf /var/lib/dde-dconfig-daemon/.config/global

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.

2 participants