From cb1a50055c9112bf18bec20f64026a3357c0d35b Mon Sep 17 00:00:00 2001 From: Brendan Allan Date: Mon, 13 Apr 2026 15:17:09 +0800 Subject: [PATCH] fix(electron): wait until ready before showing the main window (#22262) --- packages/desktop-electron/src/main/windows.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/desktop-electron/src/main/windows.ts b/packages/desktop-electron/src/main/windows.ts index 170cd877cd..95f80c1240 100644 --- a/packages/desktop-electron/src/main/windows.ts +++ b/packages/desktop-electron/src/main/windows.ts @@ -66,7 +66,7 @@ export function createMainWindow(globals: Globals) { y: state.y, width: state.width, height: state.height, - show: true, + show: false, title: "OpenCode", icon: iconPath(), backgroundColor, @@ -94,6 +94,10 @@ export function createMainWindow(globals: Globals) { wireZoom(win) injectGlobals(win, globals) + win.once("ready-to-show", () => { + win.show() + }) + return win }