Skip to content

[GUI] Show the window after the first paint instead of a white page - #4438

Closed
xvcezrqpbxtpzblrt wants to merge 1 commit into
Niko1221:mainfrom
xvcezrqpbxtpzblrt:desktop/no-white-flash-027
Closed

xvcezrqpbxtpzblrt wants to merge 1 commit into
Niko1221:mainfrom
xvcezrqpbxtpzblrt:desktop/no-white-flash-027

Conversation

@xvcezrqpbxtpzblrt

Copy link
Copy Markdown
Contributor

Problem

On a cold start the window shows the web view's default white page until the host is up and React has painted: a white flash on every launch, longer on a slow disk.

Result

  • The window is created hidden, and shown when the page says it has painted (a small ready signal from main.tsx once the first screen is committed), with a 12 s fallback in the page and a 15 s one in the shell so a failure still shows a window.
  • While it is hidden, a second launch does not open a second window.
  • The page remembers the window was hidden and asks the shell to show it, so a page that reloads later does not stay invisible.

Validation

  • Built and run on Windows: window appears with the first painted screen, no white frame.
  • cargo check clean; the Tauri capability for the show/focus commands is in tauri.conf.json.

Limits and the trade-off

  • Not run on macOS or Linux, and not measured on a slow disk: the worst case is a blank (no window) for up to 12–15 s instead of a white window for a few seconds.
  • If the owner prefers the default path untouched, an inline background colour and a static skeleton in index.html would remove the white flash without hiding the window; this branch is the more thorough version of that.

@xvcezrqpbxtpzblrt

Copy link
Copy Markdown
Contributor Author

Superseded by #4606, which carries this change with the rest of the 0.2.7 branch. Closing so the review has one place.

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.

1 participant