From 6239c8b2a697ad50b3be92d379e4143e4dd29304 Mon Sep 17 00:00:00 2001 From: Dude29 <6997743+Dude29@users.noreply.github.com> Date: Fri, 26 Jun 2020 17:41:23 +0100 Subject: [PATCH 1/2] Add code to check for app window focus upon attending to the 'quit' shortcut --- src/shortcuts.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/shortcuts.js b/src/shortcuts.js index 5293af4..6709dd9 100644 --- a/src/shortcuts.js +++ b/src/shortcuts.js @@ -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. From 7f4a3b5ccf9e7d7ea74a77041b80929209c5d7cc Mon Sep 17 00:00:00 2001 From: Dude29 <6997743+Dude29@users.noreply.github.com> Date: Sat, 27 Jun 2020 23:05:32 +0100 Subject: [PATCH 2/2] Fix some minor typos in a comment --- src/main.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.js b/src/main.js index d417fa3..1f8bbec 100644 --- a/src/main.js +++ b/src/main.js @@ -172,8 +172,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); }