From 66a8970b002175f62e121506df12bc8e7f50cc2c Mon Sep 17 00:00:00 2001 From: Juan Cruz Viotti Date: Thu, 4 Feb 2016 16:06:13 -0400 Subject: [PATCH] Fix flash of white at startup Fixes: https://github.com/resin-io/etcher/issues/122 --- lib/etcher.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lib/etcher.js b/lib/etcher.js index 17794dd0..8c8f2fa0 100644 --- a/lib/etcher.js +++ b/lib/etcher.js @@ -37,12 +37,25 @@ electron.app.on('ready', function() { mainWindow = new electron.BrowserWindow({ width: 800, height: 380, + show: false, resizable: false, fullscreen: false, titleBarStyle: 'hidden-inset', 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 = null; });