Show main window before ipcReady

It doesn't flicker anymore if we remove this option, and the app feels
no slower.
This commit is contained in:
Feross Aboukhadijeh
2016-06-01 00:25:18 -07:00
parent e88ddd648b
commit cc9ba385bf
4 changed files with 3 additions and 6 deletions

View File

@@ -25,13 +25,12 @@ var vlcProcess
function init () { function init () {
var ipc = electron.ipcMain var ipc = electron.ipcMain
ipc.on('ipcReady', function (e) { ipc.once('ipcReady', function (e) {
windows.main.show()
app.ipcReady = true app.ipcReady = true
app.emit('ipcReady') app.emit('ipcReady')
}) })
ipc.on('ipcReadyWebTorrent', function (e) { ipc.once('ipcReadyWebTorrent', function (e) {
app.ipcReadyWebTorrent = true app.ipcReadyWebTorrent = true
log('sending %d queued messages from the main win to the webtorrent window', log('sending %d queued messages from the main win to the webtorrent window',
messageQueueMainToWebTorrent.length) messageQueueMainToWebTorrent.length)

View File

@@ -31,7 +31,6 @@ function init () {
// No menu on the About window // No menu on the About window
win.setMenu(null) win.setMenu(null)
// TODO: can this be removed?
win.webContents.on('did-finish-load', function () { win.webContents.on('did-finish-load', function () {
win.show() win.show()
}) })

View File

@@ -36,7 +36,6 @@ function init () {
icon: getIconPath(), // Window icon (Windows, Linux) icon: getIconPath(), // Window icon (Windows, Linux)
minWidth: config.WINDOW_MIN_WIDTH, minWidth: config.WINDOW_MIN_WIDTH,
minHeight: config.WINDOW_MIN_HEIGHT, minHeight: config.WINDOW_MIN_HEIGHT,
show: false, // Hide window until renderer sends 'ipcReady'
title: config.APP_WINDOW_TITLE, title: config.APP_WINDOW_TITLE,
titleBarStyle: 'hidden-inset', // Hide title bar (OS X) titleBarStyle: 'hidden-inset', // Hide title bar (OS X)
useContentSize: true, // Specify web page size without OS chrome useContentSize: true, // Specify web page size without OS chrome

View File

@@ -65,7 +65,7 @@ table {
display: flex; display: flex;
flex-flow: column; flex-flow: column;
background: rgb(40, 40, 40); background: rgb(40, 40, 40);
animation: fadein 1s; animation: fadein 0.5s;
} }
.app:not(.is-focused) { .app:not(.is-focused) {