diff --git a/js/entry.js b/js/entry.js index 81d75b4ec91..70c04743ace 100644 --- a/js/entry.js +++ b/js/entry.js @@ -74,13 +74,16 @@ window.addEventListener('beforeunload', function (e) { ipc.send(messages.LAST_WINDOW_STATE, windowStore.getState().toJS()) }) -ipc.on(messages.INITIALIZE_WINDOW, (e, windowValue, appState, frames, windowState) => { +ipc.on(messages.INITIALIZE_WINDOW, (e, mem) => { + const message = mem.memory() + const windowValue = message.windowValue + currentWindow.setWindowId(windowValue.id) - const newState = Immutable.fromJS(windowState) || windowStore.getState() + const newState = Immutable.fromJS(message.windowState) || windowStore.getState() - appStoreRenderer.state = Immutable.fromJS(appState) + appStoreRenderer.state = Immutable.fromJS(message.appState) windowStore.state = newState - generateTabs(newState, frames, windowValue.id) + generateTabs(newState, message.frames, windowValue.id) appActions.windowReady(windowValue.id) ReactDOM.render(, document.getElementById('appContainer')) }) diff --git a/js/stores/appStore.js b/js/stores/appStore.js index 63fd8cc15aa..ab3626ab9fb 100644 --- a/js/stores/appStore.js +++ b/js/stores/appStore.js @@ -237,14 +237,17 @@ const createWindow = (action) => { mainWindow.webContents.on('did-finish-load', (e) => { lastEmittedState = appState mainWindow.webContents.setZoomLevel(zoomLevel[toolbarUserInterfaceScale] || 0.0) - e.sender.send(messages.INITIALIZE_WINDOW, - { + + const mem = muon.shared_memory.create({ + windowValue: { disposition: frameOpts.disposition, id: mainWindow.id }, - appState.toJS(), + appState: appState.toJS(), frames, - action.restoredState) + windowState: action.restoredState}) + + e.sender.sendShared(messages.INITIALIZE_WINDOW, mem) if (action.cb) { action.cb() }