rustdesk/flutter/macos/Runner/MainFlutterWindow.swift
SoLongAndThanksForAllThePizza d756551791 fix: macos compilation
2022-06-02 16:13:34 +08:00

25 lines
776 B
Swift

import Cocoa
import FlutterMacOS
import bitsdojo_window_macos
class MainFlutterWindow: BitsdojoWindow {
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
}
}