fix(tray): do not un-minimise the application we hand the foreground back to

ForceForegroundWindow restores an iconic target, so closing to the tray would pop back open a window the user had deliberately minimised. Skip the handback in that case and leave the choice to Windows. A -tray launch also skips it: it never took the foreground from anyone.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
r-zakarya
2026-07-27 23:14:12 +01:00
parent 33d8df3dee
commit 2a1da8913b
2 changed files with 8 additions and 2 deletions
+3 -1
View File
@@ -369,7 +369,9 @@ begin
TThread.ForceQueue(nil,
procedure
begin
FBridge.MinimizeToTray;
// No foreground handback: a -tray launch never took the foreground from
// anyone, so there is nobody to give it back to.
FBridge.MinimizeToTray(True, False);
// Hidden now — safe to pay the startup cost.
btnStartClick(Nil);
LogLine('Launched with --tray, started hidden (balloon suppressed)');