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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user