chore(autofill): le journal dit par quel geste on est entre

La barrette et le raccourci se rejoignent des FireAutofillRequest, donc
tout ce qui suit etait journalise sous "hotkey" - y compris un
remplissage declenche a la souris. Un diagnostic de lenteur qui ne sait
pas par ou l'on est entre cherche au mauvais endroit.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
r-zakarya
2026-09-02 19:36:20 +01:00
parent da74a675be
commit 77688a5af2
2 changed files with 18 additions and 7 deletions
+16 -6
View File
@@ -163,8 +163,9 @@ type
// settings_json : elle peut etre allumee coffre ferme, quand aucune session
// n'existe pour lire les reglages du serveur.
FLazyAlphaPct: Integer;
// Voir la propriete LastFillWaits.
// Voir les proprietes LastFillWaits et LastRequestFromBar.
FLastFillWaits: string;
FLastRequestFromBar: Boolean;
// Dernier etat connu du survol, pour ne reposer l'opacite que sur un
// changement - SetLayeredWindowAttributes force un repaint a chaque appel.
FLazyHover: Boolean;
@@ -179,7 +180,8 @@ type
// Capture the foreground window and hand it to the host. Shared by the
// autofill hotkeys and the lazy strip - same target, same title matching,
// same picker. Only the gesture differs.
procedure FireAutofillRequest(AKind: TAutofillKind);
procedure FireAutofillRequest(AKind: TAutofillKind;
AFromBar: Boolean = False);
procedure MsgWindowHandler(var AMsg: TMessage);
procedure PrepareNid;
procedure ShowTrayMenu;
@@ -257,6 +259,9 @@ type
/// l'hote. Une chaine plutot qu'un evenement : ExecuteAutofill s'execute
/// sur le thread principal, juste avant que l'hote journalise.
property LastFillWaits: string read FLastFillWaits;
/// Le dernier remplissage venait-il de la barrette plutot que d'un
/// raccourci ? Les deux chemins se rejoignent des FireAutofillRequest.
property LastRequestFromBar: Boolean read FLastRequestFromBar;
property SecureClipboard: TSecureClipboard read FSecureClipboard;
property TrayAdded: Boolean read FTrayAdded;
// Show or hide the lazy strip. Idempotent, and remembered across launches.
@@ -1063,13 +1068,18 @@ end;
// The target of a fill is whatever window owns the foreground at the moment
// the user asks for it - a shortcut, or a click on the lazy strip, which takes
// no foreground precisely so this stays true.
procedure TPMBridge.FireAutofillRequest(AKind: TAutofillKind);
procedure TPMBridge.FireAutofillRequest(AKind: TAutofillKind;
AFromBar: Boolean = False);
var
LTarget: HWND;
LTitle: string;
LLen: Integer;
begin
if not Assigned(FOnAutofillRequest) then Exit;
// QUI A DEMANDE. Les deux gestes partagent tout ce qui suit, donc le journal
// les confondait sous "hotkey" - et un diagnostic de lenteur qui ne sait pas
// par ou l'on est entre cherche au mauvais endroit.
FLastRequestFromBar := AFromBar;
LTarget := GetForegroundWindow;
CaptureForegroundOwner;
// Hiding to the tray does not hand the foreground to anyone else, so ours
@@ -1303,9 +1313,9 @@ begin
if HiWord(AMsg.WParam) = BN_CLICKED then
begin
case LoWord(AMsg.WParam) of
LAZY_ID_FULL: FireAutofillRequest(akFull);
LAZY_ID_PWD: FireAutofillRequest(akPasswordOnly);
LAZY_ID_TOTP: FireAutofillRequest(akTotp);
LAZY_ID_FULL: FireAutofillRequest(akFull, True);
LAZY_ID_PWD: FireAutofillRequest(akPasswordOnly, True);
LAZY_ID_TOTP: FireAutofillRequest(akTotp, True);
LAZY_ID_OPEN: if Assigned(FOnTrayRestore) then FOnTrayRestore();
LAZY_ID_CLOSE: PostMessage(FMsgWindow, WM_LAZY_CLOSE, 0, 0);
end;