Keep macOS client running in the menu bar when its window closes

Retain the main Flutter window, add reopen and explicit quit actions, and preserve its controller while hidden. Fix native test host paths and cover the window and menu lifecycle with XCTest.
This commit is contained in:
shen
2026-10-12 18:46:53 -07:00
parent c7cc2aa865
commit c94143dfae
6 changed files with 107 additions and 11 deletions
@@ -14,6 +14,13 @@ class MainFlutterWindow: NSWindow {
private var qrScanner: MeshQRScanner?
private var importing = false
override func close() {
// Hiding keeps the Flutter engine, drafts and active network sessions alive.
// Only the explicit Quit action terminates the application.
qrScanner?.cancelScan()
orderOut(nil)
}
override func awakeFromNib() {
let flutterViewController = FlutterViewController()
let windowFrame = self.frame