diff --git a/jslib b/jslib index f568c872898..6f6b5a5503b 160000 --- a/jslib +++ b/jslib @@ -1 +1 @@ -Subproject commit f568c872898c86b3cf8b5a99f8b5b377cb5b49e7 +Subproject commit 6f6b5a5503b7aeb7bbd174e3f96a33ce1c9a8037 diff --git a/src/app/accounts/lock.component.html b/src/app/accounts/lock.component.html index 8296ba3aea3..e4c48cfb706 100644 --- a/src/app/accounts/lock.component.html +++ b/src/app/accounts/lock.component.html @@ -8,12 +8,12 @@
+ [(ngModel)]="pin" required>
+ class="monospaced" [(ngModel)]="masterPassword" required>
{ @@ -58,10 +62,22 @@ export class LoginComponent extends BaseLoginComponent implements OnDestroy { case 'windowHidden': this.onWindowHidden(); break; + case 'windowIsFocused': + if (this.deferFocus === null) { + this.deferFocus = !message.windowIsFocused; + if (!this.deferFocus) { + this.focusInput(); + } + } else if (this.deferFocus && message.windowIsFocused) { + this.focusInput(); + this.deferFocus = false; + } + break; default: } }); }); + this.messagingService.send('getWindowIsFocused'); } ngOnDestroy() { diff --git a/src/main/messaging.main.ts b/src/main/messaging.main.ts index 98c3ba9eedb..cfae0842e49 100644 --- a/src/main/messaging.main.ts +++ b/src/main/messaging.main.ts @@ -60,6 +60,9 @@ export class MessagingMain { case 'setFocus': this.setFocus(); break; + case 'getWindowIsFocused': + this.windowIsFocused(); + break; case 'enableBrowserIntegration': this.main.nativeMessagingMain.generateManifests(); this.main.nativeMessagingMain.listen(); @@ -139,4 +142,12 @@ Terminal=false`; this.main.trayMain.restoreFromTray(); this.main.windowMain.win.focusOnWebView(); } + + private windowIsFocused() { + const windowIsFocused = this.main.windowMain.win.isFocused(); + this.main.windowMain.win.webContents.send('messagingService', { + command: 'windowIsFocused', + windowIsFocused: windowIsFocused, + }); + } }