Skip to content
This repository has been archived by the owner on Jan 15, 2021. It is now read-only.

Commit

Permalink
Merge pull request #92 from Dude29/quit-with-focus
Browse files Browse the repository at this point in the history
Quick fix for ALT+F4 global shortcut
  • Loading branch information
krydos authored Jun 29, 2020
2 parents 0ea2f50 + 7f4a3b5 commit 3b412d4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ function createWindow () {
});

win.webContents.on('new-window', handleRedirect)
// manage size/positio of the window
// so it can be restore next time
// manage size/position of the window
// so it can be restored next time
mainWindowState.manage(win);
}

Expand Down
4 changes: 4 additions & 0 deletions src/shortcuts.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ class shortcuts {

registerQuitShortcut() {
globalShortcut.register(this.shortcutConfig.config['quit'], () => {
if(!this.win.isFocused()) {
return;
}

// isQuitting is important for
// on('close') event where this variable is checked.
// In case it is not true then the app just minimized.
Expand Down

0 comments on commit 3b412d4

Please sign in to comment.