OS X: Prevent white flash on window open
We got the window to run less JS but now it’s shown by the main process too soon! This fixes that with a setTimeout. Perhaps when this issue is fixed (https://github.com/atom/electron/issues/861) we can remove the timeout.
This commit is contained in:
@@ -18,9 +18,12 @@ var powerSaveBlockID = 0
|
||||
|
||||
function init () {
|
||||
ipcMain.on('ipcReady', function (e) {
|
||||
console.timeEnd('init')
|
||||
app.ipcReady = true
|
||||
app.emit('ipcReady')
|
||||
setTimeout(function () {
|
||||
windows.main.show()
|
||||
console.timeEnd('init')
|
||||
}, 50)
|
||||
})
|
||||
|
||||
ipcMain.on('showOpenTorrentFile', menu.showOpenTorrentFile)
|
||||
|
||||
@@ -71,10 +71,6 @@ function createMainWindow () {
|
||||
menu.onToggleFullScreen()
|
||||
})
|
||||
|
||||
win.webContents.on('did-finish-load', function () {
|
||||
win.show()
|
||||
})
|
||||
|
||||
win.on('blur', menu.onWindowHide)
|
||||
win.on('focus', menu.onWindowShow)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user