diff --git a/delphi-backend/PMServer.dproj b/delphi-backend/PMServer.dproj index 75c9618..3f83454 100644 --- a/delphi-backend/PMServer.dproj +++ b/delphi-backend/PMServer.dproj @@ -204,7 +204,6 @@ $(PreBuildEvent)]]> PMServer_Icon1.ico app.png app.png - -tray diff --git a/delphi-backend/UMainForm.pas b/delphi-backend/UMainForm.pas index 0319ba2..c80bfa8 100644 --- a/delphi-backend/UMainForm.pas +++ b/delphi-backend/UMainForm.pas @@ -334,15 +334,17 @@ begin end; end; // Starting the server (DB open + Indy bind + WebView2 navigation) is what - // makes FormCreate run for ~1 s. The FMX taskbar proxy is created somewhere - // inside that second, and since the thread never pumps a message while it - // runs, nothing can hide the proxy until it is over — that is the taskbar - // button sitting there during the Windows logon. + // makes FormCreate run for ~1 s. On a --tray launch it therefore runs AFTER + // the tray hide, in the deferred block below, so FormCreate returns in + // milliseconds and the app is tray-resident right away. // - // On a --tray launch, do it AFTER the tray hide instead: FormCreate then - // returns in milliseconds, MinimizeToTray runs immediately, and the proxy is - // gone before it can be drawn. A normal launch is unchanged (the window is - // meant to be on screen anyway, so ordering does not matter there). + // NOTE: this was originally needed to shrink the window during which the FMX + // taskbar proxy was visible. That is no longer the reason — the proxy is now + // dealt with properly in the .dpr (StartTrayProxyHider, WS_EX_TOOLWINDOW). + // The ordering is kept because it works and reaching the tray sooner is + // desirable, NOT because anything depends on it. A normal launch keeps the + // original order. FServer is constructed earlier (see above), so FServer.Active + // reads False rather than faulting while the start is pending. if not FindCmdLineSwitch('tray', True) then btnStartClick(Nil); btnToggleLogClick(nil);