From 22f188dc64e185c77ef995a3ccaf4ade758e0e08 Mon Sep 17 00:00:00 2001 From: Pierre Jacquier Date: Tue, 18 Mar 2025 11:16:17 -0400 Subject: [PATCH] Revert "Fix window creation failures on Mac (most noteable in CI) (#5809)" This reverts commit 9c986d3aa899c4e50fa2db6a389bcaf4d81da019. --- src/main.ts | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/main.ts b/src/main.ts index 9afbdd774..ac999d110 100644 --- a/src/main.ts +++ b/src/main.ts @@ -58,6 +58,7 @@ console.log('Environment vars', process.env) console.log('Parsed CLI args', args) /// Register our application to handle all "zoo-studio:" protocols. +const singleInstanceLock = app.requestSingleInstanceLock() if (process.defaultApp) { if (process.argv.length >= 2) { app.setAsDefaultProtocolClient(ZOO_STUDIO_PROTOCOL, process.execPath, [ @@ -72,11 +73,8 @@ if (process.defaultApp) { // Must be done before ready event. // Checking against this lock is needed for Windows and Linux, see // https://www.electronjs.org/docs/latest/tutorial/launch-app-from-url-in-another-app#windows-and-linux-code -if (!IS_PLAYWRIGHT) { - const singleInstanceLock = app.requestSingleInstanceLock() - if (!singleInstanceLock) { - app.quit() - } +if (!singleInstanceLock && !IS_PLAYWRIGHT) { + app.quit() } else { registerStartupListeners() } @@ -91,7 +89,6 @@ const createWindow = (pathToOpen?: string, reuse?: boolean): BrowserWindow => { newWindow = new BrowserWindow({ autoHideMenuBar: false, show: false, - enableLargerThanScreen: true, width: 1800, height: 1200, webPreferences: { @@ -200,8 +197,6 @@ app.on('window-all-closed', () => { // initialization and is ready to create browser windows. // Some APIs can only be used after this event occurs. app.on('ready', (event, data) => { - // Avoid potentially 2 ready fires - if (mainWindow) return // Create the mainWindow mainWindow = createWindow() })