Smarted spawn hotkey behaviour on macOS to give the focus to the previous app on hide

This commit is contained in:
Eugene Pankov
2018-03-24 23:40:45 +01:00
parent 5e07dd5442
commit 3c3b14bf09
4 changed files with 8 additions and 12 deletions

View File

@@ -130,11 +130,13 @@ export class AppRootComponent {
onGlobalHotkey () {
if (this.electron.app.window.isFocused()) {
// focused
this.electron.loseFocus()
this.electron.app.window.hide()
} else {
if (!this.electron.app.window.isVisible()) {
// unfocused, invisible
this.electron.app.window.show()
this.electron.app.window.focus()
} else {
if (this.config.store.appearance.dock === 'off') {
// not docked, visible