Skip to content

fix(rt_desktop): reveal initial window on first paint (startup black flash) - #35620

Merged
crowlKats merged 2 commits into
denoland:mainfrom
crowlKats:fix/desktop-startup-black-flicker
Jul 1, 2026
Merged

crowlKats merged 2 commits into
denoland:mainfrom
crowlKats:fix/desktop-startup-black-flicker

Conversation

@crowlKats

@crowlKats crowlKats commented Jun 29, 2026 •

Copy link
Copy Markdown
Member

Closes #35530

Problem

The bootstrap desktop window was created visible up front and only navigated
to app:// after the in-process server bound (polled up to 15s). Between those,
the user stared at an empty webview. The bug is platform-independent, but on
Wayland the compositor only presents committed buffers, so the empty
pre-load frame shows as solid black — the symptom in #35530. (X11 masks it
with the theme background; macOS with white — much less noticeable.)

Fix

Reveal the window only once content has painted (the Electron ready-to-show
model), using two new laufey capabilities (littledivy/laufey#29):

  • WefDesktopApi::create_initial_window creates the bootstrap window hidden
    (LAUFEY_WINDOW_FLAG_HIDDEN) and reveals it from its on_page_load handler —
    guarded by an AtomicBool so later in-app navigations don't re-show a window
    the app has hidden.
  • navigate_fut keeps a single navigate call plus a 10s fallback show()
    so a load that never finishes (e.g. the initial navigation errors) can't leave
    the user with no window at all. show() is idempotent.

So the window's first visible frame already has content — no empty/black frame
on any backend.

Test plan

  • cargo clippy -p denort_desktop clean (against a local laufey 0.5.0 patch)
  • Manual: on Wayland, the startup black frame should be gone; window appears
    already painted. Needs verification on the reporter's setup.

… black flash

The bootstrap desktop window was created visible up front and navigated to
app:// only after the in-process server bound (up to 15s later), leaving the
user staring at an empty webview. On Wayland the compositor presents that
pre-load frame verbatim as solid black (issue denoland#35530).

Create the initial window hidden (new laufey HIDDEN flag) and reveal it from its
on_page_load handler once content has painted, so its first visible frame
already has content. A 10s fallback show() guards against a load that never
finishes (e.g. the initial navigation errors).

Requires laufey 0.5.0 (adds the hidden flag + page-load event).

Closes denoland#35530
@crowlKats
crowlKats marked this pull request as ready for review July 1, 2026 03:35
…-black-flicker

# Conflicts:
#	cli/rt_desktop/lib.rs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

deno desktop nit: black frame flicker before rendering HTML in window

2 participants