fix(autofill): send the window back to the tray when the picker is dismissed

Cancelling left the window on the desktop, though it had only been restored to
ask which entry to fill. Quick-search already hides itself on Esc; this makes
the picker symmetric. Applies to all three hotkeys — the capture and the hide
both sit on the shared BridgeAutofillRequest / autofill/cancel paths, so full,
password-only and TOTP behave identically.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
r-zakarya
2026-07-27 21:11:43 +01:00
parent 3c84bdca49
commit a9e56c52b5
2 changed files with 9 additions and 4 deletions
+8 -3
View File
@@ -1087,9 +1087,14 @@ begin
if FAutofillTargetHWND <> 0 then
SetForegroundWindow(FAutofillTargetHWND);
FAutofillTargetHWND := 0;
// Cancelled: the window stays wherever the user left it, and the captured
// state must not leak into the next hotkey.
FAutofillHotkeyWasHidden := False;
// The window only came out of the tray to show the picker, so dismissing it
// puts it back — same as quick-search, which hides on Esc too. Done after
// handing focus to the target above.
if FAutofillHotkeyWasHidden then
begin
FAutofillHotkeyWasHidden := False;
FBridge.MinimizeToTray;
end;
LogLine('Autofill cancelled (no match or dismissed)');
end