diff --git a/super_native_extensions/rust/src/lib.rs b/super_native_extensions/rust/src/lib.rs index 3f049123..79634fb6 100644 --- a/super_native_extensions/rust/src/lib.rs +++ b/super_native_extensions/rust/src/lib.rs @@ -127,6 +127,7 @@ pub extern "C" fn super_native_extensions_init() { #[cfg(target_os = "android")] mod android { + use irondash_run_loop::RunLoop; use once_cell::sync::OnceCell; use crate::init; @@ -151,6 +152,12 @@ mod android { use ::log::Level; use android_logger::Config; + // This is to ensure that engine context is not used for sending things + // to main thread. EngineContext main thread sender does not work properly + // with RunLoop::poll_once, which is used during clipboard access. + // Without this clipboard access may deadlock. + RunLoop::set_main_thread(); + android_logger::init_once( Config::default() .with_min_level(Level::Info)