7103fbf703
The minimize-then-SW_SHOWNOACTIVATE approach flickered and sometimes lost the restore race (window stayed minimized). Root fix: when the window was open before the hotkey (ARestoreAfter), skip the minimize entirely — being the foreground process is exactly what allows handing focus to the target, so the window simply stays in place beside it. Tray-origin flow keeps the old minimize (the window is a temporary overlay, trayed after the fill anyway). Safety: if the target refuses the foreground (elevated / UIPI) and our window is still foreground, bail before typing — otherwise the password would be typed into the vault's own visible UI. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>