rustdesk/flutter/macos/Runner/AppDelegate.swift

24 lines
667 B
Swift
Raw Normal View History

import Cocoa
import FlutterMacOS
@NSApplicationMain
class AppDelegate: FlutterAppDelegate {
2023-01-20 10:26:27 +08:00
var lauched = false;
override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool {
2022-06-02 16:13:34 +08:00
dummy_method_to_enforce_bundling()
return true
}
2023-01-20 01:25:15 +08:00
override func applicationShouldOpenUntitledFile(_ sender: NSApplication) -> Bool {
2023-01-20 10:26:27 +08:00
if (lauched) {
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) {
lauched = true;
NSApplication.shared.activate(ignoringOtherApps: true);
}
}