Skip to content

Commit 67d146f

Browse files
committed
Merge pull request #121 from valtlfelipe/master
Fix OS X bug when all tabs are closed
2 parents 0b07e53 + d407145 commit 67d146f

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)