From cc9ba385bf5ca03b2398833303b80e5e1ad8e8b0 Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Wed, 1 Jun 2016 00:25:18 -0700 Subject: [PATCH] Show main window before ipcReady It doesn't flicker anymore if we remove this option, and the app feels no slower. --- main/ipc.js | 5 ++--- main/windows/about.js | 1 - main/windows/main.js | 1 - renderer/main.css | 2 +- 4 files changed, 3 insertions(+), 6 deletions(-) diff --git a/main/ipc.js b/main/ipc.js index 479e00e4..8a81853f 100644 --- a/main/ipc.js +++ b/main/ipc.js @@ -25,13 +25,12 @@ var vlcProcess function init () { var ipc = electron.ipcMain - ipc.on('ipcReady', function (e) { - windows.main.show() + ipc.once('ipcReady', function (e) { app.ipcReady = true app.emit('ipcReady') }) - ipc.on('ipcReadyWebTorrent', function (e) { + ipc.once('ipcReadyWebTorrent', function (e) { app.ipcReadyWebTorrent = true log('sending %d queued messages from the main win to the webtorrent window', messageQueueMainToWebTorrent.length) diff --git a/main/windows/about.js b/main/windows/about.js index 7fba55d1..0a29d51d 100644 --- a/main/windows/about.js +++ b/main/windows/about.js @@ -31,7 +31,6 @@ function init () { // No menu on the About window win.setMenu(null) - // TODO: can this be removed? win.webContents.on('did-finish-load', function () { win.show() }) diff --git a/main/windows/main.js b/main/windows/main.js index b0f3d04b..52b5b041 100644 --- a/main/windows/main.js +++ b/main/windows/main.js @@ -36,7 +36,6 @@ function init () { icon: getIconPath(), // Window icon (Windows, Linux) minWidth: config.WINDOW_MIN_WIDTH, minHeight: config.WINDOW_MIN_HEIGHT, - show: false, // Hide window until renderer sends 'ipcReady' title: config.APP_WINDOW_TITLE, titleBarStyle: 'hidden-inset', // Hide title bar (OS X) useContentSize: true, // Specify web page size without OS chrome diff --git a/renderer/main.css b/renderer/main.css index 60be4af9..cea8c637 100644 --- a/renderer/main.css +++ b/renderer/main.css @@ -65,7 +65,7 @@ table { display: flex; flex-flow: column; background: rgb(40, 40, 40); - animation: fadein 1s; + animation: fadein 0.5s; } .app:not(.is-focused) {