[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:
@@ -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);
|
||||
|
Reference in New Issue
Block a user