Open adamdry opened 6 years ago
@adamdry This issue should have been fixed in the latest version 5.0.3
Please check and close this issue if solved.
I am using altus, which uses 5.0.3. The issue still seems to exist for me: https://github.com/ShadyThGod/altus/issues/20. I also reported an issue here as well with a workaround for users: https://github.com/electron/electron/issues/17933 Maybe this could help resolving the issue?
It keeps happening to me too. This is the configuration I have:
import { app, BrowserWindow } from 'electron'
import windowStateKeeper from 'electron-window-state'
let mainWindow
function createWindow () {
/**
* Load the previous state with fallback to defaults
*/
let mainWindowState = windowStateKeeper({
defaultWidth: 1000,
defaultHeight: 600
})
/**
* Initial window options
*/
const { width, height, x, y } = mainWindowState
mainWindow = new BrowserWindow({
width,
height,
x,
y,
webPreferences: {
nodeIntegration: true
}
})
mainWindow.setMenu(null)
mainWindow.loadURL(process.env.APP_URL)
mainWindowState.manage(mainWindow)
mainWindow.on('closed', () => {
mainWindow = null
})
}
app.on('ready', createWindow)
Experiencing this issue
You need to mention the .json file where to remember the values.
mainWindowState = windowStateKeeper({ file: 'mainWindowState.json', defaultWidth: ? defaultHeight: ? });
I did these steps:
I'm running Ubuntu 16.04, using node 7.9.0, Chrome 58.0.3029.110, and Electron 1.7.8
Edit: Further testing shows that my app's window will maximise on which ever screen the terminal window I'm launching it from is on