From cccb9ac681c5ed6fbd2da7df27f30ed3665a19bd Mon Sep 17 00:00:00 2001 From: antelle Date: Wed, 6 Nov 2019 23:01:05 +0100 Subject: [PATCH] fix #1341: auto-lock the app on screen lock on Windows --- desktop/app.js | 13 +++---------- release-notes.md | 1 + 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/desktop/app.js b/desktop/app.js index 126fa622..48dbdb15 100644 --- a/desktop/app.js +++ b/desktop/app.js @@ -23,7 +23,6 @@ const windowPositionFileName = path.join(userDataDir, 'window-position.json'); const appSettingsFileName = path.join(userDataDir, 'app-settings.json'); const tempUserDataPath = path.join(userDataDir, 'temp'); const tempUserDataPathRand = Date.now().toString() + Math.random().toString(); -const systemNotificationIds = []; let htmlPath = process.argv .filter(arg => arg.startsWith('--htmlpath=')) @@ -440,15 +439,9 @@ function subscribePowerEvents() { electron.powerMonitor.on('resume', () => { emitRemoteEvent('power-monitor-resume'); }); - if (process.platform === 'darwin') { - const id = electron.systemPreferences.subscribeNotification( - 'com.apple.screenIsLocked', - () => { - emitRemoteEvent('os-lock'); - } - ); - systemNotificationIds.push(id); - } + electron.powerMonitor.on('lock-screen', () => { + emitRemoteEvent('os-lock'); + }); } function setEnv() { diff --git a/release-notes.md b/release-notes.md index cd7c5399..81890c12 100644 --- a/release-notes.md +++ b/release-notes.md @@ -1,6 +1,7 @@ Release notes ------------- ##### v1.13.0 (TBD) +`+` #1341: auto-lock the app on screen lock on Windows `-` fix #1323: version in the About dialog `-` fix #734: OTP secrets with spaces