fix: --connect command on macOS & window closing issues

This commit is contained in:
Kingtous
2023-02-03 17:08:40 +08:00
parent 1ad55d9914
commit 66851efaa3
9 changed files with 68 additions and 28 deletions

View File

@@ -3,21 +3,22 @@ import FlutterMacOS
@NSApplicationMain
class AppDelegate: FlutterAppDelegate {
var lauched = false;
var launched = false;
override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool {
dummy_method_to_enforce_bundling()
return true
// https://github.com/leanflutter/window_manager/issues/214
return false
}
override func applicationShouldOpenUntitledFile(_ sender: NSApplication) -> Bool {
if (lauched) {
if (launched) {
handle_applicationShouldOpenUntitledFile();
}
return true
}
override func applicationDidFinishLaunching(_ aNotification: Notification) {
lauched = true;
launched = true;
NSApplication.shared.activate(ignoringOtherApps: true);
}
}