fix(hotkeys): a locked vault must not hand the foreground back

Both locked-vault paths cancelled the autofill with the default refocus, which returns the foreground to the captured target - right after Delphi had raised our window. Ctrl+Shift+Q flashed for a frame then Notepad took over; Ctrl+Shift+L moved the window twice because focusApp had to take it back.
This commit is contained in:
r-zakarya
2026-08-07 14:48:12 +01:00
parent d242f09c53
commit 476d6660ad
3 changed files with 13 additions and 5 deletions
+6 -2
View File
@@ -550,8 +550,12 @@ const Bridge = (() => {
if (typeof toast === 'function')
toast('Vault is locked — unlock to search', 'warning');
// Tell Delphi we cancelled so the captured HWND doesn't
// linger waiting for a never-coming /execute.
if (forFill && Bridge.cancelAutofill) Bridge.cancelAutofill();
// linger waiting for a never-coming /execute. refocus=false:
// Delphi has just brought our window up and we put the cursor
// in the master-password field — handing the foreground back
// to the target would undo that, which read as a 1-frame flash
// before the other application took over again.
if (forFill && Bridge.cancelAutofill) Bridge.cancelAutofill(false);
return;
}
if (typeof openQuickSearchModal === 'function')