diff --git a/main.js b/main.js index 4bcb4aa54f..74a7821f5d 100644 --- a/main.js +++ b/main.js @@ -141,7 +141,11 @@ function createWindow () { // in an array if your app supports multi windows, this is the time // when you should delete the corresponding element. mainWindow = null - }) + }); + + ipc.on('show-window', function() { + mainWindow.show(); + }); } // This method will be called when Electron has finished diff --git a/preload.js b/preload.js index 4d4cc0ea94..b306230dac 100644 --- a/preload.js +++ b/preload.js @@ -15,6 +15,10 @@ console.log('draw attention'); ipc.send('draw-attention'); }; + window.showWindow = function() { + console.log('show window'); + ipc.send('show-window'); + }; /** * Enables spell-checking and the right-click context menu in text editors. * Electron (`webFrame.setSpellCheckProvider`) only underlines misspelled words;