Files
t3code/apps
Josh Gratton 88a6e43d34 desktop: don't treat the WSL splash as the main window
The connecting splash is a real BrowserWindow, so currentMainOrFirst /
focusedMainOrFirst (which fall back to "any first window") return it
while the app is still booting. Only createMainIfBackendReady excluded
it; ensureMain, revealOrCreateMain, activate, and dispatchMenuAction
still treated it as the main window.

The backend pool deliberately swallows window-open errors raised after
backend readiness (so they cannot block restartAttempt reset). In
WSL-only mode a failed main open therefore left the splash up with no
real main while the backend was ready, and activation only re-revealed
the splash and never retried the open, stranding the user on
"Connecting to WSL".

Centralize splash exclusion in a withoutSplash helper and route every
main-window lookup (currentMainWindow / focusedMainWindow) through it, so
activate retries the open instead of latching onto the splash.
dispatchMenuAction now falls back to ensureMain rather than createMain to
avoid opening a duplicate main when one already exists.

Add a regression test: a swallowed post-readiness open failure leaves
only the splash, and activate must bring up the real main.
2026-06-16 12:20:05 -04:00
..