Open oxiez opened 4 years ago
Fixes #80. Changing the callback on webContents for dom-ready to this:
webContents
dom-ready
webContents.on('dom-ready', () => { const stylesheets = fs.readdirSync(file.style); stylesheets.forEach(x => webContents.insertCSS(readSheet(x))); console.log("dom-ready"); if (settings.get('launchMinimized')) { mainWindow.minimize(); } else { mainWindow.show(); } });
outputs the following on npm start:
npm start
> electron . dom-ready dom-ready dom-ready dom-ready dom-ready dom-ready
I believe repeated dom-ready fires was the reason for the window repeatedly stealing focus on startup. The window should now load in the background if clicked away from.
Using ready-to-show might also be an option, if the version of electron is updated: https://github.com/electron/electron/issues/7779
ready-to-show
Pushed to my own branch. Thanks. Added your name in the credits.
Fixes #80. Changing the callback on
webContents
fordom-ready
to this:outputs the following on
npm start
:I believe repeated
dom-ready
fires was the reason for the window repeatedly stealing focus on startup. The window should now load in the background if clicked away from.Using
ready-to-show
might also be an option, if the version of electron is updated: https://github.com/electron/electron/issues/7779