feat: insert core entry before launching flutter

This commit is contained in:
SoLongAndThanksForAllThePizza
2022-05-30 16:16:20 +08:00
parent 3a1bbc260b
commit 7cd0940661
4 changed files with 55 additions and 4 deletions

View File

@@ -52,6 +52,13 @@ fn initialize(app_dir: &str) {
}
}
/// FFI for rustdesk core's main entry.
/// Return true if the app should continue running with UI(possibly Flutter), false if the app should exit.
#[no_mangle]
pub extern "C" fn rustdesk_core_main() -> bool {
crate::core_main::core_main()
}
pub fn start_event_stream(s: StreamSink<String>) -> ResultType<()> {
let _ = flutter::EVENT_STREAM.write().unwrap().insert(s);
Ok(())