Repository navigation
app: a window shows once it has drawn - #378
Merged
Merged
Conversation
fizzy's window used to be shown at the end of AppInit, before its first frame, so it appeared empty for the ~80 ms that frame took (#365's phases measured it), and in a restart's handover the new window covered the old one before it had drawn. Now it is shown unseen (macOS: transparent; Windows: DWM-cloaked, not layered), draws its first frame, and is revealed as the next frame begins. A handover's new instance signals ready only once it is on screen. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
foxnne
enabled auto-merge (squash)
October 13, 2026 14:49
foxnne
disabled auto-merge
October 13, 2026 14:58
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of
plans/RESTART_AND_CRASHES_PLAN.md(open items); the gap was found with the startup phases from #365.What changes
The window never appears empty. fizzy showed its window at the end of
AppInit, before the first frame. On a launch it appeared empty for the ~80 ms that frame took. In a restart's handover (#356), the new window covered the old one before it had drawn anything.Now:
platform.window.showUndrawn). A hidden window gets nothing to present into, so it can't simply draw first and show afterwards.SDL_SetWindowOpacity0,alphaValue).DWMWA_CLOAK): shown and composited, but not on screen. That avoids SDL's opacity, which would make the window layered, whichwin32_titlebaralready rules out (it breaks native dialogs' input).platform.window.reveal). Theshownphase now comes afterfirst frame, and the log saysstartup: shown N ms after main.restart.pollReleasedran in the new instance's first frame, with its wait deadline still zero. It deleted the handover folder and took the lock while the old instance still held it, so the new instance handed its own launch over and exited. Polling now starts only once "ready" has been signalled.SDK impact
Verified
Healthcounters show the first frame was presented while the window was transparent (presents 0 → 1 between the first frame's start and the reveal, skips unchanged). So what is revealed has been drawn.first frameat 525.5 ms,shown541.7,handover ready541.7,handover lock566.0. Two handovers in a row each came up as a new instance that answered.zig build,zig build test(541/542, 1 skipped),test-integration(383/383),check-web,test-sdk-version.aarch64-windows-gnubuild launched in the user's session, sampled every 50 ms: shown and cloaked at 3852 ms, uncloaked 136 ms later. It is never left cloaked.🤖 Generated with Claude Code