소스 검색

fix(electron): wait until ready before showing the main window (#22262)

Brendan Allan 6 달 전
부모
커밋
cb1a50055c
1개의 변경된 파일과 5개의 추가작업 그리고 1개의 파일을 삭제
  1. 5 1
      packages/desktop-electron/src/main/windows.ts

+ 5 - 1
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
 }