fix #1341: auto-lock the app on screen lock on Windows

This commit is contained in:
antelle 2019-11-06 23:01:05 +01:00
parent 0a025d807b
commit cccb9ac681
2 changed files with 4 additions and 10 deletions

View File

@ -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() {

View File

@ -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