You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
transitive winit dependency in a rust library, consumed by my cdylib libexample.so.
This exports uniffi bindings for Kotlin.
Consuming Kotlin project is console or Swing application, but let's stick here on example console app with no other UI parts, except rust windowing.
libexample.so is loaded with jna.
OS is Ubuntu/Linux with openjdk.
Unfortunately, even no threading or coroutines are involved on no side, the native lib runs always in a second, consecutive thread having always a 3 numbers higher pid/tid than the main thread.
Here we talk about two java os-threads.
Therefore os thread checking like if(rustix::thread::id == rustix::process::id) will fail.
For my Kotlin Application everything runs on the java main thread.
Meanwhile I patched the winit crate locally and just return true in is_main_thread().
Everything runs smooth with that hack.
My question is: Can we consider above usecases somehow?
Can we have a feature or other Cargo.toml configuration option to circumvent other solutions like EventloopBuilder/extension/hooks (with_any_thread)?
The thing is, I want to be agnostic of wayland or whatever target and just want to use transitive code or examples as provided.
Thank you so much for your help and understanding!
P.S.: On which platforms is this feature relevant?
I would suggest to put "Linux" and "Jna/Jni" in the list.
I find the mechanism/use case is similar to Android architecture, but... It's not Android.
Relevant platforms
No response
The text was updated successfully, but these errors were encountered:
Okay, I looked again over with_any_thread api and adapted my code.
I was confused about to choose x11 or wayland and I'm still unsure which extension to use.
During my learning and hacking journey I noticed
winit::platform::unix::EventLoopBuilderExtUnix but lateron, probably in a newer version of winit, that was'nt resolved anymore.
Description
Hi there,
I have this use case:
transitive winit dependency in a rust library, consumed by my cdylib libexample.so.
This exports uniffi bindings for Kotlin.
Consuming Kotlin project is console or Swing application, but let's stick here on example console app with no other UI parts, except rust windowing.
libexample.so is loaded with jna.
OS is Ubuntu/Linux with openjdk.
Unfortunately, even no threading or coroutines are involved on no side, the native lib runs always in a second, consecutive thread having always a 3 numbers higher pid/tid than the main thread.
Here we talk about two java os-threads.
Therefore os thread checking like if(rustix::thread::id == rustix::process::id) will fail.
For my Kotlin Application everything runs on the java main thread.
Meanwhile I patched the winit crate locally and just return true in is_main_thread().
Everything runs smooth with that hack.
My question is: Can we consider above usecases somehow?
Can we have a feature or other Cargo.toml configuration option to circumvent other solutions like EventloopBuilder/extension/hooks (with_any_thread)?
The thing is, I want to be agnostic of wayland or whatever target and just want to use transitive code or examples as provided.
Thank you so much for your help and understanding!
P.S.: On which platforms is this feature relevant?
I would suggest to put "Linux" and "Jna/Jni" in the list.
I find the mechanism/use case is similar to Android architecture, but... It's not Android.
Relevant platforms
No response
The text was updated successfully, but these errors were encountered: