Reveal the main window only after the splash has painted #38
Loading…
Reference in a new issue
No description provided.
Delete branch "startup-flash-fix"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
On launch the window was created visible, so the OS showed a run of ugly intermediate frames before the splash ever appeared: the unpainted webview (black + desktop bleed-through), the static
index.html"Loading Garnet…" fallback, the liveset_sizeresize in.setup(), then finally React's splash.This creates the window hidden and reveals it from the frontend once React has committed the splash, so its first on-screen frame is the splash itself.
How
tauri.conf.json: window created withvisible: false+backgroundColorset to the splash color (#0c0b09).main.rs: newshow_main_windowcommand (idempotent), plus a 5s setup-side safety timer that reveals the window anyway if the frontend never calls.App.tsx: reveal scheduled withsetTimeout, notrequestAnimationFrame— webkit2gtk doesn't service rAF while the window is hidden, so an rAF-gated reveal never fires (that bug made the splash play out entirely off-screen). The splash's minimum dwell is now anchored to the reveal moment, not React mount, so it always shows for its full duration. The error boundary also reveals the window so render failures still surface.index.html: pre-paint background set to the splash color and the visible loading text dropped.Testing
tsc, Biome, andcargo checkall pass. Verified visually viamake devon Linux (webkit2gtk): the pre-splash frames are gone and the splash plays in full.