24 lines
683 B
Swift
24 lines
683 B
Swift
import Cocoa
|
|
import FlutterMacOS
|
|
|
|
@main
|
|
class AppDelegate: FlutterAppDelegate {
|
|
override func applicationDidFinishLaunching(_ notification: Notification) {
|
|
let bundleId = Bundle.main.bundleIdentifier ?? "mesh_drop_flutter"
|
|
let running = NSRunningApplication.runningApplications(withBundleIdentifier: bundleId)
|
|
if running.count > 1 {
|
|
NSApp.terminate(nil)
|
|
return
|
|
}
|
|
super.applicationDidFinishLaunching(notification)
|
|
}
|
|
|
|
override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool {
|
|
return true
|
|
}
|
|
|
|
override func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool {
|
|
return true
|
|
}
|
|
}
|