fix(tray): On Win32 / Linux click should open main window if closed

This commit is contained in:
Ben Gotow 2015-12-01 14:46:08 -08:00
parent 439529c51f
commit 6d2f39cd6c
2 changed files with 4 additions and 3 deletions

View file

@ -1,4 +1,4 @@
import remote from 'remote';
import {remote, ipcRenderer} from 'electron';
import TrayStore from './tray-store';
const Tray = remote.require('tray');
@ -29,7 +29,7 @@ class SystemTray {
_onClicked() {
if (this._platform !== 'darwin') {
NylasEnv.focus();
ipcRenderer.send('command', 'application:show-main-window');
}
}

View file

@ -500,7 +500,8 @@ class NylasEnvConstructor extends Model
center: ->
ipcRenderer.send('call-window-method', 'center')
# Extended: Focus the current window.
# Extended: Focus the current window. Note: this will not open the window
# if it is hidden.
focus: ->
ipcRenderer.send('call-window-method', 'focus')
window.focus()