Revert "Fix window creation failures on Mac (most noteable in CI) (#5809)"

This reverts commit 9c986d3aa8.
This commit is contained in:
Pierre Jacquier
2025-03-18 11:16:17 -04:00
committed by GitHub
parent f2c5661710
commit 22f188dc64

View File

@ -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()
})