Fix window creation failures on Mac (most noteable in CI) (#5809)
Allow window to be larger than screen on mac as well, fixing tests
This commit is contained in:
@ -58,7 +58,6 @@ console.log('Environment vars', process.env)
|
|||||||
console.log('Parsed CLI args', args)
|
console.log('Parsed CLI args', args)
|
||||||
|
|
||||||
/// Register our application to handle all "zoo-studio:" protocols.
|
/// Register our application to handle all "zoo-studio:" protocols.
|
||||||
const singleInstanceLock = app.requestSingleInstanceLock()
|
|
||||||
if (process.defaultApp) {
|
if (process.defaultApp) {
|
||||||
if (process.argv.length >= 2) {
|
if (process.argv.length >= 2) {
|
||||||
app.setAsDefaultProtocolClient(ZOO_STUDIO_PROTOCOL, process.execPath, [
|
app.setAsDefaultProtocolClient(ZOO_STUDIO_PROTOCOL, process.execPath, [
|
||||||
@ -73,8 +72,11 @@ if (process.defaultApp) {
|
|||||||
// Must be done before ready event.
|
// Must be done before ready event.
|
||||||
// Checking against this lock is needed for Windows and Linux, see
|
// 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
|
// https://www.electronjs.org/docs/latest/tutorial/launch-app-from-url-in-another-app#windows-and-linux-code
|
||||||
if (!singleInstanceLock && !IS_PLAYWRIGHT) {
|
if (!IS_PLAYWRIGHT) {
|
||||||
|
const singleInstanceLock = app.requestSingleInstanceLock()
|
||||||
|
if (!singleInstanceLock) {
|
||||||
app.quit()
|
app.quit()
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
registerStartupListeners()
|
registerStartupListeners()
|
||||||
}
|
}
|
||||||
@ -89,6 +91,7 @@ const createWindow = (pathToOpen?: string, reuse?: boolean): BrowserWindow => {
|
|||||||
newWindow = new BrowserWindow({
|
newWindow = new BrowserWindow({
|
||||||
autoHideMenuBar: false,
|
autoHideMenuBar: false,
|
||||||
show: false,
|
show: false,
|
||||||
|
enableLargerThanScreen: true,
|
||||||
width: 1800,
|
width: 1800,
|
||||||
height: 1200,
|
height: 1200,
|
||||||
webPreferences: {
|
webPreferences: {
|
||||||
@ -197,6 +200,8 @@ app.on('window-all-closed', () => {
|
|||||||
// initialization and is ready to create browser windows.
|
// initialization and is ready to create browser windows.
|
||||||
// Some APIs can only be used after this event occurs.
|
// Some APIs can only be used after this event occurs.
|
||||||
app.on('ready', (event, data) => {
|
app.on('ready', (event, data) => {
|
||||||
|
// Avoid potentially 2 ready fires
|
||||||
|
if (mainWindow) return
|
||||||
// Create the mainWindow
|
// Create the mainWindow
|
||||||
mainWindow = createWindow()
|
mainWindow = createWindow()
|
||||||
})
|
})
|
||||||
|
Reference in New Issue
Block a user