fix(desktop): prevent restored window from minimizing again - #102
Merged
Merged
Conversation
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.
点击托盘设置中的“显示 FreeOS”后,Windows 可能在窗口恢复之后才投递旧的最小化事件,现有监听会立刻再次隐藏主窗口,表现为窗口闪一下又回到最小化。
本修复把显示操作改成一个 1.5 秒的有限恢复事务:恢复开始时取消旧的托盘隐藏状态,忽略迟到的最小化事件,并在 75/250/750/1250ms 分阶段确认
UnMinimise → Show → Focus。每次恢复使用 generation 隔离,旧定时器不会干扰新的显示操作。验证:
go test ./...:通过-count=20:通过wails3 build:通过PYTHONUTF8=1 uv run pytest -n auto -m "not live":3588 passed, 114 skippednpm run build:通过说明:Windows 中文区域下未启用 UTF-8 时,16 个既有数据库测试会用 GBK 读取 UTF-8 SQL 并失败;以 Windows CI 使用的 UTF-8 Python 模式重跑后全绿,与本次桌面窗口改动无关。