feat(client/macos): 开机自启隐藏到托盘(--autostart),与 Windows 对齐

macOS 登录项(launch_at_startup)注册时带 args:['--autostart'];main() 读该参数
windowManager.hide();MainFlutterWindow.awakeFromNib 检测到 --autostart 时 orderOut
兜底(避免 storyboard Visible At Launch 闪窗)。常规启动无参数,正常显示窗口。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
wangjia
2026-06-30 01:27:30 +08:00
parent ba65b03fd5
commit 15133b8a72
2 changed files with 14 additions and 2 deletions
@@ -19,5 +19,12 @@ class MainFlutterWindow: NSWindow {
VpnChannel.register(with: flutterViewController.registrar(forPlugin: "VpnChannel"))
super.awakeFromNib()
// ( --autostart):,( Windows )
// Dart main() windowManager.hide(); orderOut , storyboard
// "Visible At Launch" ()
if CommandLine.arguments.contains("--autostart") {
self.orderOut(nil)
}
}
}