7a19bdc13b
Third discriminator measured and rejected: the log shows the restore's resize arrives with fg=True (22:44:08), so foreground ownership no more separates it from a user gesture than the placement flags did. FMX simply exposes nothing usable — no resize while iconic, and the restore's resize is indistinguishable from the user's own. So stop inferring and observe the transition at the OS level: SetWinEventHook on EVENT_SYSTEM_MINIMIZESTART / MINIMIZEEND, scoped to our process, WINEVENT_OUTOFCONTEXT (no injection, callback on our thread). Minimise start raises a guard that makes the resize handler ignore everything until the restore settles; minimise end re-applies the state the user actually left, in both directions. Hook failure is non-fatal — only the preservation is lost. Unhooked in FormDestroy. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>