[MM-54742] Force secure keyboard entry off when window loses focus and when servers switch (#2869)

* [MM-54742] Force secure keyboard entry off when window loses focus and when servers switch

* Fix for when window is not focused, added tests
This commit is contained in:
Devin Binnie
2023-10-10 10:47:13 -04:00
committed by GitHub
parent 9aec7db821
commit 36daa3d67e
5 changed files with 64 additions and 5 deletions

View File

@@ -153,6 +153,11 @@ export function handleToggleSecureInput(event: IpcMainEvent, secureInput: boolea
return;
}
// Don't allow this to turn on if the main window isn't focused
if (secureInput && !MainWindow.get()?.isFocused()) {
return;
}
// Enforce macOS to restrict processes from reading the keyboard input when in a password field
log.debug('handleToggleSecureInput', secureInput);
app.setSecureKeyboardEntryEnabled(secureInput);