From b1f1b67ed5ebaf62b32c84275cd00904aeed2124 Mon Sep 17 00:00:00 2001 From: Sal Rahman Date: Tue, 10 Nov 2026 13:09:05 -0700 Subject: [PATCH] Linux: the window shows on Wayland The window is made hidden and shown on ready-to-show, so it never flashes an empty frame. Wayland never paints a window that is not shown yet, so there ready-to-show never comes and the window stays hidden for good: npm start opened DevTools and nothing else. The page having finished loading now shows it too, whichever comes first. The window's background colour already matches the page's, so showing it a moment before its first paint does not flash. Co-Authored-By: Claude Opus 5.5 --- app/src/main/index.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/src/main/index.ts b/app/src/main/index.ts index 3524a2f..065519c 100644 --- a/app/src/main/index.ts +++ b/app/src/main/index.ts @@ -157,7 +157,15 @@ const createWindow = (windowState: WindowState) => { if (process.platform !== "darwin") mainWindow.setMenuBarVisibility(false); if (maximized) mainWindow.maximize(); - mainWindow.once("ready-to-show", () => mainWindow.show()); + // Shown once it has painted. Wayland never paints a window that is not + // shown yet, so there `ready-to-show` never comes and the window would + // stay hidden for good: the page having loaded shows it too, whichever + // is first. The background colour above keeps that from flashing. + const show = () => { + if (!mainWindow.isDestroyed() && !mainWindow.isVisible()) mainWindow.show(); + }; + mainWindow.once("ready-to-show", show); + mainWindow.webContents.once("did-finish-load", show); windowState.trackWindowState(mainWindow); const source = rendererSource(