Add ability to unhide the window from the renderer
via ipc, for instance if a notification is clicked but the window is closed/hidden. // FREEBIE
This commit is contained in:
parent
f716f70bf4
commit
b5649a6874
2 changed files with 9 additions and 1 deletions
6
main.js
6
main.js
|
@ -141,7 +141,11 @@ function createWindow () {
|
||||||
// in an array if your app supports multi windows, this is the time
|
// in an array if your app supports multi windows, this is the time
|
||||||
// when you should delete the corresponding element.
|
// when you should delete the corresponding element.
|
||||||
mainWindow = null
|
mainWindow = null
|
||||||
})
|
});
|
||||||
|
|
||||||
|
ipc.on('show-window', function() {
|
||||||
|
mainWindow.show();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// This method will be called when Electron has finished
|
// This method will be called when Electron has finished
|
||||||
|
|
|
@ -15,6 +15,10 @@
|
||||||
console.log('draw attention');
|
console.log('draw attention');
|
||||||
ipc.send('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.
|
* Enables spell-checking and the right-click context menu in text editors.
|
||||||
* Electron (`webFrame.setSpellCheckProvider`) only underlines misspelled words;
|
* Electron (`webFrame.setSpellCheckProvider`) only underlines misspelled words;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue