From dcb1ac63cecf07e6e0523f0dfe2cd6071543fd5f Mon Sep 17 00:00:00 2001 From: r-zakarya <82443831+r-zakarya@users.noreply.github.com> Date: Fri, 18 Sep 2026 22:40:00 +0100 Subject: [PATCH] fix(totp): pas de notification 'toujours dans le tray' pendant le scan du QR Co-Authored-By: Claude Opus 5 --- delphi-backend/Source/PM.Bridge.pas | 8 +++++--- delphi-backend/UMainForm.pas | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/delphi-backend/Source/PM.Bridge.pas b/delphi-backend/Source/PM.Bridge.pas index b787f0a..f7fb0d7 100644 --- a/delphi-backend/Source/PM.Bridge.pas +++ b/delphi-backend/Source/PM.Bridge.pas @@ -217,7 +217,7 @@ type // it before we came out of the tray. False for callers that already decided // who should be focused (post-autofill hands it to the filled window). procedure MinimizeToTray(AClearClipboard: Boolean = True; - AReturnForeground: Boolean = True); + AReturnForeground: Boolean = True; ANotify: Boolean = True); // Record the application currently in the foreground as the one to restore // focus to when we go back to the tray. Ignores our own and shell windows. procedure CaptureForegroundOwner; @@ -835,7 +835,7 @@ begin end; procedure TPMBridge.MinimizeToTray(AClearClipboard: Boolean = True; - AReturnForeground: Boolean = True); + AReturnForeground: Boolean = True; ANotify: Boolean = True); var LFormHwnd, LAppHwnd: HWND; begin @@ -893,7 +893,9 @@ begin // 3. First-time only: pop a balloon notification so the user knows the // app is still running in the tray (and didn't crash). Skipped when // the user opted out via Settings. - if (not FBalloonShown) and FShowNotifications then + // ANotify=False : absence de quelques centaines de ms (scan du QR), la + // fenetre revient seule - l'annonce "toujours dans le tray" serait fausse. + if ANotify and (not FBalloonShown) and FShowNotifications then begin ShowFirstTimeBalloon; FBalloonShown := True; diff --git a/delphi-backend/UMainForm.pas b/delphi-backend/UMainForm.pas index e38d809..fd455ae 100644 --- a/delphi-backend/UMainForm.pas +++ b/delphi-backend/UMainForm.pas @@ -1399,7 +1399,7 @@ begin else if ACmd = 'qr/screen' then begin LogLine('qr/screen: scanning'); - FBridge.MinimizeToTray(False, False); + FBridge.MinimizeToTray(False, False, False); TThread.CreateAnonymousThread( procedure var