Conversation
将壁纸切换过渡从交叉淡化改为拉幕式效果:新壁纸在 wallpaperReady 后从屏幕右侧滑入覆盖旧壁纸,滑动结束后恢复 anchors.fill 布局并 清理旧槽位,同时避免快速连续切换时对动画中槽位的悬空删除。 Switch the wallpaper transition from cross-fade to a curtain effect: once the new wallpaper surface is ready, it slides in from the right edge to cover the old one; anchors.fill is restored and the old slot is cleaned up when the slide finishes. Log: 壁纸切换改为拉幕式过渡动画 Influence: 壁纸切换动画由交叉淡化改为拉幕式滑入,过渡更自然。 Multica Issue: WM-557
修复评审问题 1/2/3 并采纳问题 4: - finishSlideIn 恢复槽位可见性,修复零尺寸分支下壁纸区域永久黑屏; - 切换前先停止在途动画让当前槽位原地完成,已显示的被顶替槽位 升级为 backdrop、未显示的停靠槽位直接回收,保证新壁纸就绪前 屏幕上始终有一个全覆盖的可见壁纸; - 用显式 shown 标记代替 isVisible() 判断,避免祖先不可见时误删; - ready/finished 回调改捕 QPointer,析构时先停动画; - opacityDuration 更名 transitionDuration(QML 无调用方)。 Fixes from code review: restore slot visibility in finishSlideIn to avoid a permanent black screen in the zero-size path; stop the in-flight slide before superseding so a shown slot always remains as backdrop while the next wallpaper waits for ready; use an explicit shown flag instead of isVisible(); guard callbacks with QPointer; rename opacityDuration to transitionDuration. Log: 修复快速切换壁纸槽位可见性问题 Influence: 快速切换中始终保留可见壁纸槽位,消除黑屏回归。 Multica Issue: WM-557
|
Skipping CI for Draft Pull Request. |
|
[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. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Reviewer's Guide本 PR 在 WallpaperSwitcherItem 中以基于 x 坐标的拉幕式滑入动画替换交叉淡化,并围绕 wallpaperReady、快速连续切换和零尺寸布局重构槽位可见性与生命周期管理;同时将公开的时长属性重命名为 transitionDuration。 Sequence diagram for curtain-style wallpaper switchingsequenceDiagram
participant Switcher as WallpaperSwitcherItem
participant Slot as WallpaperSlot
participant Surface as WallpaperSurfaceInterface
participant Animation as QPropertyAnimation
Switcher->>Slot: switchToNewSlot()
Switcher->>Slot: setVisible(false)
Switcher->>Slot: setX(width())
Switcher->>Surface: wallpaperReady()
alt wallpaper ready
Switcher->>Switcher: startSlideIn(Slot)
else wait for ready
Surface-->>Switcher: ready
Switcher->>Switcher: startSlideIn(Slot)
end
Switcher->>Slot: setVisible(true)
Switcher->>Animation: start x animation
Animation-->>Switcher: finished
Switcher->>Switcher: finishSlideIn(Slot)
Switcher->>Slot: setX(0)
Switcher->>Slot: anchors.fill
Switcher->>Slot: deleteLater old slot
State diagram for wallpaper slot visibilitystateDiagram-v2
[*] --> Parked
Parked: visible=false, shown=false
Parked --> Sliding: wallpaperReady / startSlideIn
Sliding: visible=true, x=width()
Sliding --> Displayed: animation finished / finishSlideIn
Displayed: shown=true, anchors.fill
Sliding --> Parked: newer switch / stop animation
Parked --> [*]: newer switch / deleteLater
Displayed --> Backdrop: newer switch
Backdrop: oldSlot, fully visible
Backdrop --> [*]: replacement finished / deleteLater
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Interrupted animations are not finalized, and delayed-ready slots can retain stale geometry, causing uncovered wallpaper regions;动画中断及槽位尺寸过期可能导致壁纸区域未覆盖。
Review effort: Balanced
Findings: 1
What changed in this PR
为壁纸切换引入拉幕式滑入动画,并改进连续切换时的槽位管理。 Adds a curtain-style wallpaper transition and improves slot lifecycle handling during rapid switches.
Changes:
- 将淡入淡出替换为
OutCubic横向滑入动画。 Replaces cross-fading with anOutCubicslide-in. - 重命名过渡时长 API,并跟踪活动动画。 Renames the duration API and tracks active animations.
- 增加未就绪槽位与零尺寸处理。 Handles pending and zero-sized slots.
| File | Description |
|---|---|
src/wallpaper/wallpaperswitcheritem.h |
声明过渡 API 与动画状态。 Declares transition APIs and animation state. |
src/wallpaper/wallpaperswitcheritem.cpp |
实现拉幕动画及槽位清理。 Implements curtain animation and slot cleanup. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| if (m_slideAnim) { | ||
| m_slideAnim->stop(); // finished -> finishSlideIn completes the current slot | ||
| m_slideAnim = nullptr; | ||
| } |

Summary
为壁纸切换添加拉幕式(curtain-style)过渡动画,并修复快速连续切换场景下的槽位可见性问题。
wallpaperReady后以OutCubic缓动滑入覆盖旧壁纸(时长复用transitionDuration,默认 500ms),滑动结束后恢复anchors.fill布局并清理旧槽位。stop()在途动画让当前槽位原地完成,已显示的被顶替槽位升级为 backdrop、未显示的停靠槽位直接回收,保证新壁纸就绪前屏幕上始终有一个全覆盖的可见壁纸;同时修复零尺寸分支下可能出现的永久黑屏。Checklist
src/wallpaper/wallpaperswitcheritem.{h,cpp}(+72/-35)关联 Multica Issue: WM-557
Summary by Sourcery
Add a curtain-style wallpaper transition while making rapid switching robust.
New Features:
Bug Fixes:
Enhancements: