Skip to content

Commit bf8f82f

Browse files
committed
Merge branch 'master' of github.com:BoostIO/Boostnote
2 parents 5468c60 + 7eeba0c commit bf8f82f

5 files changed

Lines changed: 24 additions & 10 deletions

File tree

browser/finder/NoteDetail.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const { clipboard } = electron
1111
const path = require('path')
1212

1313
function notify (title, options) {
14-
if (process.platform === 'win32') {
14+
if (global.process.platform === 'win32') {
1515
options.icon = path.join('file://', global.__dirname, '../../resources/app.png')
1616
}
1717
return new window.Notification(title, options)

browser/finder/index.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,12 @@ const { remote } = electron
1515
const { Menu } = remote
1616

1717
function hideFinder () {
18-
if (process.platform === 'win32') {
19-
remote.getCurrentWindow().minimize()
20-
return
18+
let finderWindow = remote.getCurrentWindow()
19+
if (global.process.platform === 'win32') {
20+
finderWindow.blur()
21+
finderWindow.hide()
2122
}
22-
if (process.platform === 'darwin') {
23+
if (global.process.platform === 'darwin') {
2324
Menu.sendActionToFirstResponder('hide:')
2425
}
2526
remote.getCurrentWindow().hide()
@@ -48,6 +49,7 @@ class FinderMain extends React.Component {
4849
}
4950

5051
componentDidMount () {
52+
this.refs.search.focus()
5153
window.addEventListener('focus', this.focusHandler)
5254
window.addEventListener('blur', this.blurHandler)
5355
}

browser/finder/ipcClient.js

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,21 @@ function toggleFinder () {
3030
finderWindow.show()
3131
}
3232
} else {
33-
if (!finderWindow.isMinimized()) {
34-
finderWindow.minimize()
33+
if (finderWindow.isVisible()) {
34+
finderWindow.blur()
35+
finderWindow.hide()
3536
} else {
3637
nodeIpc.of.node.emit('request-data')
37-
finderWindow.restore()
38+
finderWindow.show()
39+
finderWindow.focus()
3840
}
41+
// if (!finderWindow.isMinimized()) {
42+
// finderWindow.minimize()
43+
// } else {
44+
// nodeIpc.of.node.emit('request-data')
45+
// finderWindow.restore()
46+
// finderWindow.focus()
47+
// }
3948
}
4049
}
4150

lib/main-menu.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ var boost = OSX
4949
submenu: [
5050
{
5151
label: 'Quit',
52-
accelerator: 'Command+Q',
52+
accelerator: 'Control+Q',
5353
click: function () {
5454
mainWindow.webContents.send('quit-app', {})
5555
}
@@ -88,7 +88,7 @@ if (LINUX) {
8888
label: 'Quit Boostnote',
8989
accelerator: 'Control + Q',
9090
click: function () {
91-
mainWindow.close()
91+
mainWindow.webContents.send('quit-app', {})
9292
}
9393
})
9494
}

lib/main-window.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ mainWindow.webContents.sendInputEvent({
3333
})
3434

3535
mainWindow.on('close', function (e) {
36+
if (process.platform === 'linux' && process.env.DESKTOP_SESSION !== 'cinnamon') {
37+
return true
38+
}
3639
mainWindow.hide()
3740
e.preventDefault()
3841
})

0 commit comments

Comments
 (0)