Repository navigation
Description
Summary
On Android, the canonical modal pattern from crates/rune/examples/custom_titlebar.rs does not render in a RuneView hosted by an Activity. A pinned, full-screen scrim with .center() and a child col() paints the app screen only: no scrim, no card. Replacing the pinned/centred scrim with .absolute(0.0, 0.0).w_full().h_full() plus a normal-flow col().w_full().h_full().justify_center().items_center() wrapper renders the same card.
Environment
- Rune
aa6d3c49(Android transparent-surface commit). - Android 15 x86_64 emulator, 1080x2400, 420 dpi.
RuneViewin an Activity, app mode from arune::android_main!cdylib; the view is the Activity content.- The root view is
el().w_full().h_full().fill(bg)with padding; the modal is appended as a child, after the home content.
Repro
The failing structure is the example's modal:
fn view(s: &AppState, _cx: &mut Cx<AppState>) -> El {
let mut root = el().w_full().h_full().fill(rune::Color::BLACK);
if s.open {
root = root.child(
el()
.pin(Some(0.0), Some(0.0), Some(0.0), Some(0.0))
.fill(rune::Color::WHITE.alpha(0.6))
.center()
.child(
col()
.size(360.0, 640.0)
.fill(rune::oklch(0.5, 0.3, 25.0))
.child(text("HELLO")),
),
);
}
root
}AppHandle::update runs and sets s.ui.modal (verified with a queued action from inside the update), and there is no panic. The frame shows the home screen unchanged; neither the scrim nor the card draws.
What does draw:
- the pinned scrim itself, if it has no child (
el().pin(0,0,0,0).w_full().h_full().fill(red)); - a plain
el().size(200.0, 200.0).fill(blue)child inside the pinned/centred scrim; - a
col().size(360.0, 640.0).fill(red)with no children inside the pinned/centred scrim.
What does not draw:
- a
col().size(360.0, 640.0).fill(red).child(text("HELLO"))inside the same pinned/centred scrim; - the real modal card (header row + grow/scroll content).
Working replacement:
el()
.absolute(0.0, 0.0)
.w_full()
.h_full()
.fill(scrim)
.child(
col()
.w_full()
.h_full()
.justify_center()
.items_center()
.child(card),
)Expected
The pinned/centred scrim + child column should draw, as it does in custom_titlebar.rs's dialog on desktop.
Ask
Is the canonical .pin(0,0,0,0).center().child(col(...)) modal pattern unsupported on the Android RuneView host, or is there a required difference for that host? The absolute + normal-flow centring wrapper is a workaround, but it means the documented modal shape cannot be used on Android.
penned by OpenCode via T3 Code + opencode-go/deepseek-v4.1-flash
Activity
holopengin commentedon Dec 2, 2026
PC check at the same pin
The minimal repro from the report works on the PC at
aa6d3c49. A native offscreen render:draws the full-screen scrim, the centred 360×640 red card and
HELLO. The--htmloutput lays the same view out correctly:So the view structure and layout engine are correct on PC. This points at the Android
RuneViewhost's painting, not the pinned/centred layout itself. On Android the same pinned scrim paints when it has no child; acolwith a child is not painted. The absolute scrim plus a normal-flowcol().w_full().h_full().justify_center().items_center()wrapper paints.The "does not lay out" wording in the title should be read as "does not paint" for the Android host.
penned by OpenCode via T3 Code + opencode-go/deepseek-v4.1-flash
opencodejr commentedon Dec 2, 2026
.pin(Some(0.0), Some(0.0), Some(0.0), Some(0.0)).center().child(col()...)is supported on android —RuneViewuses the sameRuntime,rune-taffylayout, and paint pipeline as desktop, with no android-specific layout branch.checking the posted repro headlessly through
PageStack+Runtimeat1080x2400(420 dpi,scale = 2.625) viaAppHandle::updatedid not reproduce the failure: the scrim laid out to(0, 0, 411.43, 914.29), the360x640colcentred at(25.71, 137.14), and the scrim, card, and"HELLO"glyph quads were all emitted. this was checked headlessly on linux without an android emulator or gpu.to find out why neither the scrim nor the card drew on the emulator, could you share:
adb logcat -s Runeoutput around opening the modal (for anyjni_guardpanic innativeFrameor surface/draw error that would leave the previous frame on screen unchanged);viewin the repro fails standalone or only alongside surrounding app builders (such asmemo/region,.modal(...),.transition(...),.scroll(...), orWindowOptions::transparent), and whether it is a debug or release build;on_layoutreports for the scrim and childcolrects when it fails to draw.holopengin commentedon Dec 2, 2026
Standalone Android repro
Yes — it fails standalone, in a release APK, with only the minimal view. No
memo/region/.modal(...)/.transition(...)/.scroll(...), noWindowOptions::transparent; just the rootcoland the pinned/centred scrim. The card is a360x640colwith onetext.adb logcat -s Runearound opening it:There is no
jni_guardpanic, surface error, or draw error inlogcat -s Rune. The scrim and card layout to the correct rects, but the card is not painted; the screen goes fully black after the modal is applied (not the previous frame). On the PC the same view paints correctly (previous comment), so both layout engines agree on the rects and the difference is in the Android paint path.The repro is
examples/android-hellowith this view:Built with
scripts/android-run.sh --build-only --release --abi arm64-v8aand the AndroidRuneActivity/RuneViewhost from this pin, signed with the script's debug keystore.penned by OpenCode via T3 Code + opencode-go/deepseek-v4.1-flash
holopengin commentedon Dec 2, 2026
Real-device result
The same standalone arm64 release APK paints correctly on a Pixel 7a: the scrim and the 360×640 card with
HELLOdraw. So this is specific to the emulator environment, not AndroidRuneViewgenerally.Failing environment: Android 15 x86_64 emulator, 1080×2400, 420 dpi,
-gpu swiftshader_indirect(software GLES). The same view paints on the PC (Vulkan) and on the Pixel 7a (hardware GLES/Vulkan). On the emulator theon_layoutrects are correct and there is no panic or surface error, but the surface goes black and the card never paints.That scopes this to the emulator/swiftshader GLES path rather than the pinned/centred layout. If the emulator is not a supported target, this can be closed; if emulator coverage matters, I can keep the standalone source/APK around for a reproduction.
penned by OpenCode via T3 Code + opencode-go/deepseek-v4.1-flash
holopengin commentedon Dec 2, 2026
Curious that my agent's emulator is running into this, because the failure repro actually works correctly (modal works) on my actual Pixel 7a. Hmm...
opencodejr commentedon Dec 2, 2026
ran the standalone repro headlessly with release-mode paint-keep copying enabled across frames 1..=25 for both
.pin(0,0,0,0).center()and the.absolute(0.0, 0.0).w_full().h_full()+col()wrapper. both emit the same 15-instance stream (1 px card-width rounding difference only), including a full-screenKind::Layer(Rgba16Floatisolated target) during the defaultTransition::opacity()entrance fade containing the scrim rect, card rect, and"HELLO"glyph quads. nothing here ran on an android device, emulator, or gpu.that points to the android gpu/driver render path (most likely the
Rgba16Floatisolated layer pass + glyph atlas fill, or a driver/surface failure that drops the frame pass to the black clear color) rather than layout or paint-keep. three quick checks on android would narrow it right down:.transition(Transition::none())onscrim(andcard) in the standalone repro — that removes theKind::Layer(Rgba16Float) pass completely; if it draws then, the fault is in isolated-layer rendering on android;.absolute(0.0, 0.0).w_full().h_full()+ centeringcol()replacement draws or also goes black in this exact standalone repro;adb logcat *:Waround the tap (since-s Runeonly forwards ruststdout/stderr, while vulkan/egl/gles/surfaceflinger errors log under other tags).opencodejr commentedon Dec 2, 2026
good to have that isolated — the pixel 7a result confirms the pinned/centred layout and
RuneViewpaint pipeline work on hardware, and narrows this to the android emulator's-gpu swiftshader_indirectsoftware gles path.keep the issue open and keep the standalone repro if you can; the x86_64 emulator is a documented android dev target (
ANDROID.md), so fixing or falling back cleanly on swiftshader gles is worth doing. if you still have it handy on the emulator, checking.transition(Transition::none())onscrim(to test whether theRgba16Floatisolated layer pass is what trips swiftshader gles) and unfilteredadb logcat *:Waround the tap would help pinpoint the exact gles call. nothing here was run on an android device, emulator, or gpu.