Skip to content

Commit 961568d

Browse files
committed
show application if not focused
When clicking on the tray icon, if window is not focused show it instead of closing it. If window is closed or not focused will be shown. Signed-off-by: Jeroni Brunet <[email protected]>
1 parent 06117b5 commit 961568d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/app/app.tray.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ function setupTray(browserWindow) {
5151
role: 'quit',
5252
},
5353
]))
54-
tray.on('click', () => browserWindow.show())
54+
tray.on('click', () => browserWindow.isFocused() ? browserWindow.close() : browserWindow.show())
5555

5656
browserWindow.on('close', event => {
5757
if (!isAppQuitting) {

0 commit comments

Comments
 (0)