2022-05-23 16:25:55 +08:00
|
|
|
import Cocoa
|
|
|
|
import FlutterMacOS
|
|
|
|
|
|
|
|
@NSApplicationMain
|
|
|
|
class AppDelegate: FlutterAppDelegate {
|
2023-02-03 17:08:40 +08:00
|
|
|
var launched = false;
|
2022-05-23 16:25:55 +08:00
|
|
|
override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool {
|
2022-06-02 16:13:34 +08:00
|
|
|
dummy_method_to_enforce_bundling()
|
2023-02-03 17:08:40 +08:00
|
|
|
// https://github.com/leanflutter/window_manager/issues/214
|
|
|
|
return false
|
2022-05-23 16:25:55 +08:00
|
|
|
}
|
2023-01-20 01:25:15 +08:00
|
|
|
|
|
|
|
override func applicationShouldOpenUntitledFile(_ sender: NSApplication) -> Bool {
|
2023-02-03 17:08:40 +08:00
|
|
|
if (launched) {
|
2023-01-20 10:26:27 +08:00
|
|
|
handle_applicationShouldOpenUntitledFile();
|
|
|
|
}
|
2023-01-20 01:25:15 +08:00
|
|
|
return true
|
|
|
|
}
|
2023-01-20 10:26:27 +08:00
|
|
|
|
|
|
|
override func applicationDidFinishLaunching(_ aNotification: Notification) {
|
2023-02-03 17:08:40 +08:00
|
|
|
launched = true;
|
2023-01-20 10:26:27 +08:00
|
|
|
NSApplication.shared.activate(ignoringOtherApps: true);
|
|
|
|
}
|
2022-05-23 16:25:55 +08:00
|
|
|
}
|