HumbleUI / JWM

Cross-platform window management and OS integration library for Java
Apache License 2.0
571 stars 46 forks source link

Workaround `-XstartOnMainThread` requirement on macos #213

Closed mworzala closed 2 years ago

mworzala commented 2 years ago

The following does not require the start parameter to be set, and will move to the main thread for init when not already on it. The caveat being that all user init must be done in the callback added to App#init.

!! I was not able to test the changes on the linux/windows side.

As always comments are very welcome, I have not worked with JNI much so it's very possible I made mistakes.

Also, init does not seem like a particularly descriptive name for App#init anymore.

Closes #210

mworzala commented 2 years ago

One more note: I have not tried building it with native-image (no arm build), but using jpackage works fine (not sure if it had issues prior).

tonsky commented 2 years ago

Thanks, seems to work nice! It’s going to simplify Clojure REPL-based workflows so much!