Skip to content

fix(desktop): restore maximized window from tray#3568

Merged
esengine merged 2 commits into
esengine:main-v2from
wade19990814-hue:codex/fix-tray-maximized-restore
Jun 8, 2026
Merged

fix(desktop): restore maximized window from tray#3568
esengine merged 2 commits into
esengine:main-v2from
wade19990814-hue:codex/fix-tray-maximized-restore

Conversation

@wade19990814-hue

Copy link
Copy Markdown
Contributor

What

Restore a maximized desktop window to its maximized state after it is hidden to the system tray.

Fixes #3475.

Why

The normal startup path restores WindowState.Maximised, but the tray restore path only called WindowShow and WindowUnminimise. On Windows, closing a maximized window to the tray and reopening it therefore restored a non-maximized window.

How

  • Record whether the window was maximized immediately before background hide.
  • Consume that one-shot state when the window is reopened.
  • Re-maximize after show/unminimise on Windows and Linux.
  • Keep macOS application-level hide/show behavior unchanged.
  • Route tray open through the existing main-window restore path.

Testing

  • go test . -run 'TestBackground(CloseHideStrategyByPlatform|RestoreMaximiseStrategy)|TestTrayMenuLabelsFollowLocale|TestBeforeCloseAllowsSystemQuitWhenBackgroundCloseEnabled' -count=1
  • wails build (Windows amd64)

go test ./... still has three unrelated existing Windows failures: a locked TempDir cleanup, skill path state, and a test filename containing a double quote that Windows rejects.

@github-actions github-actions Bot added v2 Go rewrite (1.x) — main-v2 branch, active development desktop Wails desktop app (desktop/**) labels Jun 8, 2026
@wade19990814-hue

Copy link
Copy Markdown
Contributor Author

Windows manual verification passed after the follow-up fix: maximized window -> close to tray -> reopen from tray restores directly as maximized, without the normal-size window flash.

@esengine esengine left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Verified: background-restore strategy tests pass; nice fix for the maximized-window flash on tray restore.

@esengine esengine merged commit 55e683d into esengine:main-v2 Jun 8, 2026
9 checks passed
@wade19990814-hue wade19990814-hue deleted the codex/fix-tray-maximized-restore branch June 9, 2026 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

desktop Wails desktop app (desktop/**) v2 Go rewrite (1.x) — main-v2 branch, active development

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: windows, 最大化下关闭窗口,点击托盘图标,不能恢复最大化窗口

2 participants