fix: don't start the app from main() on android; use the real inset retry
main() must not run real_main on android. The library's DT_INIT points at Odin's _odin_entry_point, which the loader runs the moment NativeActivity dlopens libmain.so -- before the glue calls android_main, so context.user_ptr is nil and backend_init faults writing app.onAppCmd. The proc still has to exist: package main requires it and it is the desktop entry point. The insets retry now uses request_render_at. A plain request_render made before the build is consumed by the frame it is running in, so it schedules nothing and the loop parks with insets unresolved; it only appeared to work because the first frames redraw anyway while the tree settles. Guards the JNI-only paths (show_toast, refresh_insets) behind the android subtarget so the shared real_main is usable on desktop. refresh_insets returns true there rather than false: zero insets are correct where there are no system bars, and returning false would retry every frame forever. Also declares appCategory=game, and enables the engine's frame timings. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -13,10 +13,11 @@
|
||||
|
||||
<application
|
||||
android:label="Dogfooding"
|
||||
android:appCategory="game"
|
||||
android:hasCode="false"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:debuggable="false">
|
||||
android:debuggable="true">
|
||||
|
||||
<activity android:name="android.app.NativeActivity"
|
||||
android:configChanges="orientation|keyboardHidden"
|
||||
|
||||
Reference in New Issue
Block a user