mirror of
https://github.com/balena-io/etcher.git
synced 2025-07-23 11:16:39 +00:00
Merge pull request #141 from resin-io/fix/122/flash-of-white
Fix flash of white at startup
This commit is contained in:
commit
d1844b3830
@ -37,12 +37,25 @@ electron.app.on('ready', function() {
|
|||||||
mainWindow = new electron.BrowserWindow({
|
mainWindow = new electron.BrowserWindow({
|
||||||
width: 800,
|
width: 800,
|
||||||
height: 380,
|
height: 380,
|
||||||
|
show: false,
|
||||||
resizable: false,
|
resizable: false,
|
||||||
fullscreen: false,
|
fullscreen: false,
|
||||||
titleBarStyle: 'hidden-inset',
|
titleBarStyle: 'hidden-inset',
|
||||||
icon: path.join(__dirname, '..', 'assets', 'icon.png')
|
icon: path.join(__dirname, '..', 'assets', 'icon.png')
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Prevent flash of white when starting the application
|
||||||
|
// https://github.com/atom/electron/issues/2172
|
||||||
|
mainWindow.webContents.on('did-finish-load', function() {
|
||||||
|
|
||||||
|
// The flash of white is still present for a very short
|
||||||
|
// while after the WebView reports it finished loading
|
||||||
|
setTimeout(function() {
|
||||||
|
mainWindow.show();
|
||||||
|
}, 100);
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
mainWindow.on('closed', function() {
|
mainWindow.on('closed', function() {
|
||||||
mainWindow = null;
|
mainWindow = null;
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user