diff --git a/browser/finder/NoteDetail.js b/browser/finder/NoteDetail.js index d339265b..ca1fc978 100644 --- a/browser/finder/NoteDetail.js +++ b/browser/finder/NoteDetail.js @@ -11,7 +11,7 @@ const { clipboard } = electron const path = require('path') function notify (title, options) { - if (process.platform === 'win32') { + if (global.process.platform === 'win32') { options.icon = path.join('file://', global.__dirname, '../../resources/app.png') } return new window.Notification(title, options) diff --git a/browser/finder/index.js b/browser/finder/index.js index 99d7ddb2..1f4d1121 100644 --- a/browser/finder/index.js +++ b/browser/finder/index.js @@ -15,11 +15,12 @@ const { remote } = electron const { Menu } = remote function hideFinder () { - if (process.platform === 'win32') { - remote.getCurrentWindow().minimize() - return + let finderWindow = remote.getCurrentWindow() + if (global.process.platform === 'win32') { + finderWindow.blur() + finderWindow.hide() } - if (process.platform === 'darwin') { + if (global.process.platform === 'darwin') { Menu.sendActionToFirstResponder('hide:') } remote.getCurrentWindow().hide() @@ -48,6 +49,7 @@ class FinderMain extends React.Component { } componentDidMount () { + this.refs.search.focus() window.addEventListener('focus', this.focusHandler) window.addEventListener('blur', this.blurHandler) } diff --git a/browser/finder/ipcClient.js b/browser/finder/ipcClient.js index e3382368..57a45869 100644 --- a/browser/finder/ipcClient.js +++ b/browser/finder/ipcClient.js @@ -30,12 +30,21 @@ function toggleFinder () { finderWindow.show() } } else { - if (!finderWindow.isMinimized()) { - finderWindow.minimize() + if (finderWindow.isVisible()) { + finderWindow.blur() + finderWindow.hide() } else { nodeIpc.of.node.emit('request-data') - finderWindow.restore() + finderWindow.show() + finderWindow.focus() } + // if (!finderWindow.isMinimized()) { + // finderWindow.minimize() + // } else { + // nodeIpc.of.node.emit('request-data') + // finderWindow.restore() + // finderWindow.focus() + // } } } diff --git a/lib/main-menu.js b/lib/main-menu.js index 4059cf00..4a5486f3 100644 --- a/lib/main-menu.js +++ b/lib/main-menu.js @@ -49,7 +49,7 @@ var boost = OSX submenu: [ { label: 'Quit', - accelerator: 'Command+Q', + accelerator: 'Control+Q', click: function () { mainWindow.webContents.send('quit-app', {}) } @@ -88,7 +88,7 @@ if (LINUX) { label: 'Quit Boostnote', accelerator: 'Control + Q', click: function () { - mainWindow.close() + mainWindow.webContents.send('quit-app', {}) } }) } diff --git a/lib/main-window.js b/lib/main-window.js index b93b3c6c..dd275e39 100644 --- a/lib/main-window.js +++ b/lib/main-window.js @@ -33,6 +33,9 @@ mainWindow.webContents.sendInputEvent({ }) mainWindow.on('close', function (e) { + if (process.platform === 'linux' && process.env.DESKTOP_SESSION !== 'cinnamon') { + return true + } mainWindow.hide() e.preventDefault() })