fix: replace hardcoded wallpaper timers with event-driven ready signal#1029
Draft
deepin-wm wants to merge 1 commit into
Draft
fix: replace hardcoded wallpaper timers with event-driven ready signal#1029deepin-wm wants to merge 1 commit into
deepin-wm wants to merge 1 commit into
Conversation
|
Skipping CI for Draft Pull Request. |
There was a problem hiding this comment.
Sorry @deepin-wm, you have reached your weekly rate limit of 500000 diff characters.
Please try again later or upgrade to continue using Sourcery
|
[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 |
1. Replace 3000ms QTimer in WallpaperItem::scheduleUpdate() with event-driven logic that listens for the ready signal from wallpaper surface 2. Add 500ms fallback timer in case the client does not send the ready request 3. Implement ready() signal in TreelandWallpaperSurfaceInterfaceV1 and emit it when the client sends the ready request 4. Client (wallpaper-factory) sends ready after QQuickWindow afterRendering, with m_readySent guard to prevent duplicates 5. Remove 2000ms QTimer delay in updateSurface() for Desktop wallpaper, emit sourceChanged() immediately instead 6. Add clearPendingUpdate() and applyPendingUpdate() helper methods for clean signal/timer lifecycle management Log: Wallpaper switching now responds immediately instead of waiting 3 seconds Influence: 1. Test wallpaper switching responsiveness in personalization settings 2. Verify wallpaper changes with both static and video wallpapers 3. Test fallback behavior when wallpaper client does not send ready signal 4. Verify no regression on lockscreen wallpaper updates 5. Test rapid consecutive wallpaper switches fix: 替换壁纸硬编码定时器为事件驱动的ready信号机制 1. 替换WallpaperItem::scheduleUpdate()中的3000ms定时器为 事件驱动逻辑,监听壁纸surface的ready信号后立即更新 2. 添加500ms兜底定时器,防止客户端未发送ready请求时 壁纸无法更新 3. 在TreelandWallpaperSurfaceInterfaceV1中实现ready()信号, 客户端发送ready请求时触发 4. 客户端(wallpaper-factory)在QQuickWindow afterRendering后 发送ready请求,使用m_readySent防止重复发送 5. 移除updateSurface()中桌面壁纸的2000ms延迟,改为 立即emit sourceChanged() 6. 添加clearPendingUpdate()和applyPendingUpdate()辅助方法, 管理信号和定时器的生命周期 Log: 壁纸切换立即响应,不再等待3秒 Influence: 1. 测试个性化设置中壁纸切换的响应速度 2. 验证静态壁纸和视频壁纸的切换功能 3. 测试壁纸客户端未发送ready信号时的兜底行为 4. 验证锁屏壁纸更新无回归问题 5. 测试快速连续切换壁纸的场景
36ff7cc to
c53502a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
修复壁纸切换3秒延迟
问题
个性化切换壁纸时,存在约3秒延迟,无法立即切换。
根因
WallpaperItem::scheduleUpdate()中使用QTimer::singleShot(3000, ...)硬编码了3秒延迟,compositor不知道wallpaper客户端何时完成渲染,因此用固定3秒等待作为同步机制。修改方案
用协议 v2 已定义的
ready机制替代硬编码定时器,实现事件驱动的壁纸切换:TreelandWallpaperSurfaceInterfaceV1::ready()信号后立即更新afterRendering后发送ready请求涉及文件
src/wallpaper/wallpaperitem.cpp/.h— 替换定时器为事件驱动逻辑src/modules/wallpaper/wallpapershellinterfacev1.cpp/.h— 添加 ready 信号wallpaper-factory/qwaylandwallpapersurface.cpp/_p.h— 客户端发送 ready 请求