修复引入 减少动画更新 时导致的错误#227
Open
XUANJI233 wants to merge 1 commit into
Open
Conversation
- ensure topology sync runs on background-state transitions to toggle animationEffect reliably - pause UI tickers while app is backgrounded and resume on foreground events - clean up window controls debug print and minor sync timestamp handling Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
该 PR 旨在修复“减少动画更新”引入后,应用从后台恢复时动画无法正确恢复的问题;通过统一/加强前后台状态切换处理,并在拓扑图同步逻辑中识别“动画状态变化”,确保在恢复/切换时能够强制刷新并恢复动画表现。
Changes:
- 在主界面根据
isInBackground使用TickerMode统一暂停/恢复动画 tick,并新增窗口事件统一处理入口。 - 优化网络拓扑图
_syncGraph:识别动画开关状态变化(animationStateChanged),在后台/降低更新频率场景下也能在需要时强制同步。 - 移除若干调试
print输出,减少无关日志噪声。
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| lib/shared/widgets/common/windows_controls.dart | 移除最小化按钮的调试输出,保持最小化时仍设置后台状态。 |
| lib/shared/widgets/common/network_topology.dart | 改进拓扑同步触发条件:背景状态变化与动画状态变化可触发强制刷新,避免恢复时动画不生效。 |
| lib/screens/main_screen.dart | 引入基于后台状态的 TickerMode,并新增 onWindowEvent 统一处理窗口事件来驱动后台状态切换。 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+145
to
+150
| if (const {'hide', 'minimize', 'blur'}.contains(eventName)) { | ||
| _setAppBackground(true); | ||
| return; | ||
| } | ||
|
|
||
| if (const {'show', 'restore', 'focus', 'unminimize'}.contains(eventName)) { |
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.
修复引入 减少动画更新 时导致动画恢复失败,现在改为统一事件处理,修复问题