rustdesk/flutter/macos/Runner/MainFlutterWindow.swift

25 lines
782 B
Swift
Raw Normal View History

import Cocoa
import FlutterMacOS
// import bitsdojo_window_macos
class MainFlutterWindow: NSWindow {
2022-06-02 16:13:34 +08:00
override func awakeFromNib() {
if (!rustdesk_core_main()){
print("Rustdesk core returns false, exiting without launching Flutter app")
NSApplication.shared.terminate(self)
}
let flutterViewController = FlutterViewController.init()
let windowFrame = self.frame
self.contentViewController = flutterViewController
self.setFrame(windowFrame, display: true)
RegisterGeneratedPlugins(registry: flutterViewController)
super.awakeFromNib()
}
// override func bitsdojo_window_configure() -> UInt {
// return BDW_CUSTOM_FRAME | BDW_HIDE_ON_STARTUP
// }
}