feat: optimize macOS application lifecycle and window management#29
feat: optimize macOS application lifecycle and window management#29kckylechen1 wants to merge 1 commit intoLampese:mainfrom
Conversation
- Implement tray icon with click-to-reopen functionality - Hide Dock icon only after the main window is closed - Add 'Open Codex Switcher' and 'Quit' items to the tray menu - Ensure the application remains accessible from the menu bar
Lampese
left a comment
There was a problem hiding this comment.
Requesting changes for two behavioral issues:
-
The close interception is not scoped to macOS.
WindowEvent::CloseRequestedis now prevented for all platforms, and the window is hidden unconditionally. Only the Dock visibility call is macOS-specific. That means Windows and Linux users also get a new "hide to tray" close behavior even though the PR is framed as a macOS lifecycle optimization. -
The PR description says reopening should temporarily restore the Dock icon on macOS, but that behavior is not actually implemented. The code hides the Dock on close via
set_dock_visibility(false), yet neithershow_main_window()nor theRunEvent::Reopenpath turns Dock visibility back on. So the implemented behavior does not match the stated reopen flow.
I think both issues should be resolved before merging. If this is meant to be a macOS-specific lifecycle adjustment, the close interception should be scoped accordingly, and the Dock visibility restore path needs to be explicit.
PR简介
优化 macOS 应用程序的生命周期和窗口管理,使其符合原生菜单栏工具(Menu Bar Utility)的行为(类似 Antigravity Manager)。
Summary
Improve macOS window lifecycle to behave like a native tray utility.
Changes
Verification