From 63dd7a296a281ce2b6b776fd1921308426de2910 Mon Sep 17 00:00:00 2001 From: r-zakarya <82443831+r-zakarya@users.noreply.github.com> Date: Sat, 25 Jul 2026 22:54:30 +0100 Subject: [PATCH] chore(window): trim the winstate diagnostics now the fix is confirmed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The traces did their job: hwnd=657868 vs form=657842 proved Win+D minimises the FMX taskbar proxy, not the form — which is why the earlier HWND filter swallowed every event. Two full cycles then showed minimise start/end firing and the re-maximise landing, with no stray "user resize" during the restore. Keeps the two lines worth having: the hook install result (a silent failure would be baffling) and the correction itself, which is rare. Co-Authored-By: Claude Opus 4.8 --- delphi-backend/UMainForm.pas | 8 -------- 1 file changed, 8 deletions(-) diff --git a/delphi-backend/UMainForm.pas b/delphi-backend/UMainForm.pas index 1459258..5db9d0b 100644 --- a/delphi-backend/UMainForm.pas +++ b/delphi-backend/UMainForm.pas @@ -1568,8 +1568,6 @@ begin // the proxy, which an equality test against the form handle rejected. The // hook is already scoped to our own process, and WebView2 lives in separate // processes, so anything arriving here is ours. - MainForm.LogLine(Format('[winstate] hook event=%d hwnd=%d form=%d', - [AEvent, AWnd, WindowHandleToPlatform(MainForm.Handle).Wnd])); if AEvent = EVENT_SYSTEM_MINIMIZESTART then MainForm.WinStateMinimizeStart else if AEvent = EVENT_SYSTEM_MINIMIZEEND then MainForm.WinStateMinimizeEnd; end; @@ -1579,16 +1577,12 @@ end; procedure TMainForm.WinStateMinimizeStart; begin FIgnoreResizes := True; - LogLine('[winstate] minimise start (want_max=' + - BoolToStr(FWantMaximized, True) + ')'); end; // Back up: re-apply what the user had. Queued so it lands after FMX has // finished sizing the window — inline loses that race. procedure TMainForm.WinStateMinimizeEnd; begin - LogLine('[winstate] minimise end (want_max=' + - BoolToStr(FWantMaximized, True) + ')'); TThread.ForceQueue(nil, procedure var @@ -1625,8 +1619,6 @@ begin if FWantMaximized <> IsZoomed(LHwnd) then begin FWantMaximized := IsZoomed(LHwnd); - LogLine('[winstate] user resize: want_max=' + - BoolToStr(FWantMaximized, True)); end; end;