Fix behaviour, if "Show icon on menu bar" was previously not selected

This commit is contained in:
Martin Gondermann
2016-07-03 22:13:48 +02:00
parent a1155bf989
commit 3c0c448502
2 changed files with 20 additions and 2 deletions

View File

@@ -358,6 +358,11 @@ app.on('ready', function() {
if (shouldShowTrayIcon()) {
const tray_menu = require('./main/menus/tray').createDefault(mainWindow);
trayIcon.setContextMenu(tray_menu);
if (process.platform === 'darwin') {
// store a reference to the tray icon, for checking in the settings, if the application
// was restarted after setting "Show icon on menu bar"
mainWindow.tray = trayIcon;
}
}
// Open the DevTools.