From 4c1451ae71eb72d2c6830128eeb1c0bae4d6689f Mon Sep 17 00:00:00 2001 From: Quentin Decaunes Date: Fri, 1 Mar 2019 17:09:39 +0100 Subject: [PATCH] See #1 Better tray interactivity. --- main.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/main.js b/main.js index aa6c264..0896f2e 100644 --- a/main.js +++ b/main.js @@ -46,7 +46,7 @@ function createWindow () { mainWindow.hide(); } }); - + var contextMenu = Menu.buildFromTemplate([ { label: 'Show App', @@ -65,6 +65,10 @@ function createWindow () { tray = new Tray(__dirname + '/assets/icon.ico'); tray.setContextMenu(contextMenu); + tray.setIgnoreDoubleClickEvents(true); + tray.on('click', function() { + mainWindow.show(); + }); } // This method will be called when Electron has finished