[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

@@ -27,6 +27,7 @@ import {
MAIN_WINDOW_RESIZED,
MAIN_WINDOW_FOCUSED,
VIEW_FINISHED_RESIZING,
TOGGLE_SECURE_INPUT,
} from 'common/communication';
import Config from 'common/config';
import {Logger} from 'common/log';
@@ -314,6 +315,7 @@ export class MainWindow extends EventEmitter {
globalShortcut.unregisterAll();
this.emit(MAIN_WINDOW_RESIZED, this.getBounds());
ipcMain.emit(TOGGLE_SECURE_INPUT, null, false);
// App should save bounds when a window is closed.
// However, 'close' is not fired in some situations(shutdown, ctrl+c)