Skip to content

修复引入 减少动画更新 时导致的错误#227

Open
XUANJI233 wants to merge 1 commit into
ldoubil:mainfrom
XUANJI233:main
Open

修复引入 减少动画更新 时导致的错误#227
XUANJI233 wants to merge 1 commit into
ldoubil:mainfrom
XUANJI233:main

Conversation

@XUANJI233

Copy link
Copy Markdown
Contributor

修复引入 减少动画更新 时导致动画恢复失败,现在改为统一事件处理,修复问题

- 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>
Copilot AI review requested due to automatic review settings May 10, 2026 06:12

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)) {
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