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:
@@ -163,8 +163,9 @@ type
|
|||||||
// settings_json : elle peut etre allumee coffre ferme, quand aucune session
|
// settings_json : elle peut etre allumee coffre ferme, quand aucune session
|
||||||
// n'existe pour lire les reglages du serveur.
|
// n'existe pour lire les reglages du serveur.
|
||||||
FLazyAlphaPct: Integer;
|
FLazyAlphaPct: Integer;
|
||||||
// Voir la propriete LastFillWaits.
|
// Voir les proprietes LastFillWaits et LastRequestFromBar.
|
||||||
FLastFillWaits: string;
|
FLastFillWaits: string;
|
||||||
|
FLastRequestFromBar: Boolean;
|
||||||
// Dernier etat connu du survol, pour ne reposer l'opacite que sur un
|
// Dernier etat connu du survol, pour ne reposer l'opacite que sur un
|
||||||
// changement - SetLayeredWindowAttributes force un repaint a chaque appel.
|
// changement - SetLayeredWindowAttributes force un repaint a chaque appel.
|
||||||
FLazyHover: Boolean;
|
FLazyHover: Boolean;
|
||||||
@@ -179,7 +180,8 @@ type
|
|||||||
// Capture the foreground window and hand it to the host. Shared by the
|
// Capture the foreground window and hand it to the host. Shared by the
|
||||||
// autofill hotkeys and the lazy strip - same target, same title matching,
|
// autofill hotkeys and the lazy strip - same target, same title matching,
|
||||||
// same picker. Only the gesture differs.
|
// same picker. Only the gesture differs.
|
||||||
procedure FireAutofillRequest(AKind: TAutofillKind);
|
procedure FireAutofillRequest(AKind: TAutofillKind;
|
||||||
|
AFromBar: Boolean = False);
|
||||||
procedure MsgWindowHandler(var AMsg: TMessage);
|
procedure MsgWindowHandler(var AMsg: TMessage);
|
||||||
procedure PrepareNid;
|
procedure PrepareNid;
|
||||||
procedure ShowTrayMenu;
|
procedure ShowTrayMenu;
|
||||||
@@ -257,6 +259,9 @@ type
|
|||||||
/// l'hote. Une chaine plutot qu'un evenement : ExecuteAutofill s'execute
|
/// l'hote. Une chaine plutot qu'un evenement : ExecuteAutofill s'execute
|
||||||
/// sur le thread principal, juste avant que l'hote journalise.
|
/// sur le thread principal, juste avant que l'hote journalise.
|
||||||
property LastFillWaits: string read FLastFillWaits;
|
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 SecureClipboard: TSecureClipboard read FSecureClipboard;
|
||||||
property TrayAdded: Boolean read FTrayAdded;
|
property TrayAdded: Boolean read FTrayAdded;
|
||||||
// Show or hide the lazy strip. Idempotent, and remembered across launches.
|
// 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 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
|
// the user asks for it - a shortcut, or a click on the lazy strip, which takes
|
||||||
// no foreground precisely so this stays true.
|
// no foreground precisely so this stays true.
|
||||||
procedure TPMBridge.FireAutofillRequest(AKind: TAutofillKind);
|
procedure TPMBridge.FireAutofillRequest(AKind: TAutofillKind;
|
||||||
|
AFromBar: Boolean = False);
|
||||||
var
|
var
|
||||||
LTarget: HWND;
|
LTarget: HWND;
|
||||||
LTitle: string;
|
LTitle: string;
|
||||||
LLen: Integer;
|
LLen: Integer;
|
||||||
begin
|
begin
|
||||||
if not Assigned(FOnAutofillRequest) then Exit;
|
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;
|
LTarget := GetForegroundWindow;
|
||||||
CaptureForegroundOwner;
|
CaptureForegroundOwner;
|
||||||
// Hiding to the tray does not hand the foreground to anyone else, so ours
|
// 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
|
if HiWord(AMsg.WParam) = BN_CLICKED then
|
||||||
begin
|
begin
|
||||||
case LoWord(AMsg.WParam) of
|
case LoWord(AMsg.WParam) of
|
||||||
LAZY_ID_FULL: FireAutofillRequest(akFull);
|
LAZY_ID_FULL: FireAutofillRequest(akFull, True);
|
||||||
LAZY_ID_PWD: FireAutofillRequest(akPasswordOnly);
|
LAZY_ID_PWD: FireAutofillRequest(akPasswordOnly, True);
|
||||||
LAZY_ID_TOTP: FireAutofillRequest(akTotp);
|
LAZY_ID_TOTP: FireAutofillRequest(akTotp, True);
|
||||||
LAZY_ID_OPEN: if Assigned(FOnTrayRestore) then FOnTrayRestore();
|
LAZY_ID_OPEN: if Assigned(FOnTrayRestore) then FOnTrayRestore();
|
||||||
LAZY_ID_CLOSE: PostMessage(FMsgWindow, WM_LAZY_CLOSE, 0, 0);
|
LAZY_ID_CLOSE: PostMessage(FMsgWindow, WM_LAZY_CLOSE, 0, 0);
|
||||||
end;
|
end;
|
||||||
|
|||||||
@@ -1978,7 +1978,8 @@ begin
|
|||||||
WebBrowser.ExecuteJavaScript(
|
WebBrowser.ExecuteJavaScript(
|
||||||
'if(window.Bridge&&typeof Bridge.onAutofillRequest==="function")' +
|
'if(window.Bridge&&typeof Bridge.onAutofillRequest==="function")' +
|
||||||
'Bridge.onAutofillRequest("' + LTitle + '","' + LKind + '")');
|
'Bridge.onAutofillRequest("' + LTitle + '","' + LKind + '")');
|
||||||
LogLine('Autofill hotkey (' + LKind + ') — foreground: "' + ATitle + '"');
|
LogLine('Autofill ' + IfThen(FBridge.LastRequestFromBar, 'fill bar', 'hotkey') +
|
||||||
|
' (' + LKind + ') — foreground: "' + ATitle + '"');
|
||||||
end;
|
end;
|
||||||
|
|
||||||
initialization
|
initialization
|
||||||
|
|||||||
Reference in New Issue
Block a user