Skip to content

Commit

Permalink
Show main window before ipcReady
Browse files Browse the repository at this point in the history
It doesn't flicker anymore if we remove this option, and the app feels
no slower.
  • Loading branch information
feross committed Jun 1, 2016
1 parent e88ddd6 commit cc9ba38
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 6 deletions.
5 changes: 2 additions & 3 deletions main/ipc.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 0 additions & 1 deletion main/windows/about.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
})
Expand Down
1 change: 0 additions & 1 deletion main/windows/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion renderer/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit cc9ba38

Please sign in to comment.