Skip to content

Commit d407145

Browse files
committed
Fix OSX all tabs closed
1 parent b38a6bd commit d407145

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

main.build.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,17 @@ app.on("open-url", function (e, url) {
119119
}
120120
});
121121

122+
/**
123+
* Emitted when the application is activated, which usually happens when clicks on the applications's dock icon
124+
* https://github.com/electron/electron/blob/master/docs/api/app.md#event-activate-os-x
125+
*
126+
* Opens a new tab when all tabs are closed, and min is still open by clicking on the application dock icon
127+
*/
128+
app.on("activate", function functionName(/*e, hasVisibleWindows*/) {
129+
if (!mainWindow) {
130+
createWindow();
131+
}
132+
});
122133

123134
function createAppMenu() {
124135
// create the menu. based on example from http://electron.atom.io/docs/v0.34.0/api/menu/

main/main.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,17 @@ app.on("open-url", function (e, url) {
119119
}
120120
});
121121

122+
/**
123+
* Emitted when the application is activated, which usually happens when clicks on the applications's dock icon
124+
* https://github.com/electron/electron/blob/master/docs/api/app.md#event-activate-os-x
125+
*
126+
* Opens a new tab when all tabs are closed, and min is still open by clicking on the application dock icon
127+
*/
128+
app.on("activate", function functionName(/*e, hasVisibleWindows*/) {
129+
if (!mainWindow) {
130+
createWindow();
131+
}
132+
});
122133

123134
function createAppMenu() {
124135
// create the menu. based on example from http://electron.atom.io/docs/v0.34.0/api/menu/

0 commit comments

Comments
 (0)