From e403678a232f73282064daa65e1a18724f47029a Mon Sep 17 00:00:00 2001 From: Ammar Date: Tue, 2 Dec 2025 12:36:13 -0600 Subject: [PATCH] =?UTF-8?q?=F0=9F=A4=96=20fix:=20skip=20splash=20screen=20?= =?UTF-8?q?on=20macOS=20dock=20reactivation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ERR_FAILED (-2) loading splash.html from ASAR intermittently on macOS dock reactivation because: - macOS App Nap throttles idle apps - File descriptors to ASAR archive may be reclaimed after inactivity - The activate event fires before I/O is fully responsive Fix: Skip the splash screen on reactivation. Services are already loaded from initial launch, so window creation is fast (~100ms). The splash exists to cover heavy initialization—unnecessary on reactivation. _Generated with mux_ --- src/desktop/main.ts | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/src/desktop/main.ts b/src/desktop/main.ts index 5b4e6075b8..3ea4fbfe3d 100644 --- a/src/desktop/main.ts +++ b/src/desktop/main.ts @@ -557,27 +557,9 @@ if (gotTheLock) { }); app.on("activate", () => { - // Only create window if app is ready and no window exists - // This prevents "Cannot create BrowserWindow before app is ready" error + // Skip splash on reactivation - services already loaded, window creation is fast if (app.isReady() && mainWindow === null) { - void (async () => { - try { - await showSplashScreen(); - await loadServices(); - createWindow(); - } catch (error) { - console.error(`[${timestamp()}] Failed to recreate window:`, error); - closeSplashScreen(); - - const errorMessage = - error instanceof Error ? `${error.message}\n\n${error.stack ?? ""}` : String(error); - - dialog.showErrorBox( - "Window Creation Failed", - `Failed to recreate the application window:\n\n${errorMessage}` - ); - } - })(); + createWindow(); } }); }