diff --git a/src/u_editor.pas b/src/u_editor.pas index 065ed30f..9750a236 100644 --- a/src/u_editor.pas +++ b/src/u_editor.pas @@ -7,7 +7,7 @@ interface uses Classes, SysUtils, FileUtil, Forms, Controls, lcltype, Graphics, SynEditKeyCmds, ComCtrls, SynEditHighlighter, ExtCtrls, Menus, SynMacroRecorder, dialogs, LazFileUtils, - SynPluginSyncroEdit, SynEdit, SynHighlighterMulti, u_dialogs, + SynPluginSyncroEdit, SynEdit, SynHighlighterMulti, AnchorDocking, u_dialogs, u_widget, u_interfaces, u_synmemo, u_dlang, u_common, u_dcd, u_observer, u_sharedres, u_controls, u_writableComponent, u_dsgncontrols, LMessages; @@ -454,7 +454,11 @@ end; function TEditorWidget.closeQuery: boolean; begin - result := inherited and Parent.isNil; + result := inherited and (Parent.isNil or + // already set as dockable but not docked + // necessary because it has te closed programmatically during loading sequence + // otherwise the layout reloading has no effect. + Parent is TAnchorDockHostSite and Parent.Parent.isNil); end; procedure TEditorWidget.setToolBarFlat(value: boolean); diff --git a/src/u_main.pas b/src/u_main.pas index 9a38224f..3917feaa 100644 --- a/src/u_main.pas +++ b/src/u_main.pas @@ -1898,8 +1898,8 @@ var x: TXMLConfigStorage; s: TMemoryStream; f: string; - t: string; i: integer; + w: TDexedWidget; begin result := false; f := getDocPath + 'docking.xml'; @@ -1920,8 +1920,10 @@ begin x := TXMLConfigStorage.Create(f, true); try try - DockMaster.CloseAll; - self.Visible:=true; + // without this the relaoding fails + // see https://bugs.freepascal.org/view.php?id=34454 + for w in fWidgList do + w.Close; DockMaster.LoadLayoutFromConfig(x, false); except exit;