From c2428a4dd14b436d07ecc9a58f5f485607cd9eb1 Mon Sep 17 00:00:00 2001 From: juha Date: Sun, 20 Aug 2017 09:02:32 +0000 Subject: [PATCH] AnchorDocking: Fix save-restore of MainForm.WindowState with TAnchorDockPanel. Issue #32302, patch from Andrey Zubarev. git-svn-id: trunk@55712 - --- components/anchordocking/anchordocking.pas | 5 ++++- components/anchordocking/anchordockstorage.pas | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/components/anchordocking/anchordocking.pas b/components/anchordocking/anchordocking.pas index 0821f50d1b..53d50c72d7 100644 --- a/components/anchordocking/anchordocking.pas +++ b/components/anchordocking/anchordocking.pas @@ -1835,11 +1835,14 @@ begin if (ANode.NodeType<>adltnPages) and (aHostSite.Pages<>nil) then aHostSite.FreePages; end; - if Site is TCustomForm then + if Site is TCustomForm then begin if AParent=nil then TCustomForm(Site).WindowState:=ANode.WindowState else TCustomForm(Site).WindowState:=wsNormal; + end else + GetParentForm(Site).WindowState:=ANode.WindowState; + end; function TAnchorDockMaster.GetNodeSite(Node: TAnchorDockLayoutTreeNode): TAnchorDockHostSite; diff --git a/components/anchordocking/anchordockstorage.pas b/components/anchordocking/anchordockstorage.pas index f4f1c77185..5642262e0d 100644 --- a/components/anchordocking/anchordockstorage.pas +++ b/components/anchordocking/anchordockstorage.pas @@ -1129,7 +1129,7 @@ begin Monitor:=TCustomForm(AControl).Monitor.MonitorNum; WorkAreaRect:=TCustomForm(AControl).Monitor.WorkareaRect; end else - WindowState:=wsNormal; + WindowState:=GetParentForm(AControl).WindowState; if AControl is TCustomTabControl then TabPosition:=TCustomTabControl(AControl).TabPosition else