From f228ab12a3e3ec8fdc11d8d3ba8b20e4e450e03a Mon Sep 17 00:00:00 2001 From: mattias Date: Wed, 9 Sep 2015 15:26:07 +0000 Subject: [PATCH] IDE: RestoreSimpleLayout: trigger layoutchanged only if something changed git-svn-id: trunk@49798 - --- components/anchordocking/anchordocking.pas | 2 +- components/ideintf/idewindowintf.pas | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/components/anchordocking/anchordocking.pas b/components/anchordocking/anchordocking.pas index eb2468b0d2..a0fb9b390b 100644 --- a/components/anchordocking/anchordocking.pas +++ b/components/anchordocking/anchordocking.pas @@ -2041,7 +2041,7 @@ begin // clean up FreeAndNil(fTreeNameToDocker); ControlNames.Free; - // commit (this can raise an exception) + // commit (this can raise an exception, when it triggers events) EnableAllAutoSizing; end; {$IFDEF VerboseAnchorDockRestore} diff --git a/components/ideintf/idewindowintf.pas b/components/ideintf/idewindowintf.pas index b884c32f33..72403afcf4 100644 --- a/components/ideintf/idewindowintf.pas +++ b/components/ideintf/idewindowintf.pas @@ -2239,22 +2239,26 @@ var i: Integer; ALayout: TSimpleWindowLayout; AForm: TCustomForm; + HasChanged: Boolean; begin if IDEDockMaster=nil then begin + HasChanged:=false; for i:=SimpleLayoutStorage.Count-1 downto 0 do//loop down in order to keep z-order of the forms begin ALayout:=SimpleLayoutStorage[i]; AForm:=GetForm(ALayout.FormID,ALayout.Visible); if AForm=nil then Continue; + HasChanged:=true; ALayout.Apply(True); if ALayout.Visible or (AForm=Application.MainForm) then ShowForm(AForm,true) else if AForm.Visible then AForm.Close; end; + if HasChanged then + LayoutChanged; end; - LayoutChanged; end; function TIDEWindowCreatorList.GetScreenrectForDefaults: TRect;