Browse Source

Improved tray click in Linux

Fixes #942
pull/1203/head
Ramiro Saenz 8 years ago
parent
commit
e57a8962b1
  1. 24
      electron/tray.js

24
electron/tray.js

@ -34,9 +34,27 @@ exports.create = function(win, config) {
appIcon = new Tray(iconPath); appIcon = new Tray(iconPath);
appIcon.setToolTip('Rambox'); appIcon.setToolTip('Rambox');
appIcon.setContextMenu(contextMenu); appIcon.setContextMenu(contextMenu);
appIcon.on('double-click', function() {
win.webContents.executeJavaScript('ipc.send("toggleWin", true);'); switch (process.platform) {
}); case 'darwin':
break;
case 'linux':
case 'freebsd':
case 'sunos':
// Double click is not supported and Click its only supported when app indicator is not used.
// Read more here (Platform limitations): https://github.com/electron/electron/blob/master/docs/api/tray.md
appIcon.on('click', function() {
win.webContents.executeJavaScript('ipc.send("toggleWin", true);');
});
break;
case 'win32':
appIcon.on('double-click', function() {
win.webContents.executeJavaScript('ipc.send("toggleWin", true);');
});
break;
default:
break;
}
}; };
exports.destroy = function() { exports.destroy = function() {

Loading…
Cancel
Save