chore(window): trim the winstate diagnostics now the fix is confirmed
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 <noreply@anthropic.com>
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user