diff --git a/ide/environmentopts.pp b/ide/environmentopts.pp index 7fdaa8d09f..b3348b8b4d 100644 --- a/ide/environmentopts.pp +++ b/ide/environmentopts.pp @@ -2233,7 +2233,8 @@ begin end; //automatically save active desktops - if AutoSaveActiveDesktop then + if AutoSaveActiveDesktop + and (Application.MainForm<>nil) and Application.MainForm.Visible then begin //save active desktop Desktop.ImportSettingsFromIDE; diff --git a/ide/main.pp b/ide/main.pp index a389178921..fdfefdb43b 100644 --- a/ide/main.pp +++ b/ide/main.pp @@ -1357,6 +1357,7 @@ var CfgCache: TFPCTargetConfigCache; OldLazDir: String; Note: string; + OI: TSimpleWindowLayout; begin {$IFDEF DebugSearchFPCSrcThread} ShowSetupDialog:=true; @@ -1417,6 +1418,10 @@ begin Application.Terminate; exit; end; + // show OI with empty configuration + OI := IDEWindowIntf.IDEWindowCreators.SimpleLayoutStorage.ItemByFormID(DefaultObjectInspectorName); + if OI<>nil then + OI.Visible := True; EnvironmentOptions.Save(true); if OldLazDir<>EnvironmentOptions.LazarusDirectory then begin // fetch new translations diff --git a/ide/sourcefilemanager.pas b/ide/sourcefilemanager.pas index 096f9d3980..fcaed5e288 100644 --- a/ide/sourcefilemanager.pas +++ b/ide/sourcefilemanager.pas @@ -2153,7 +2153,6 @@ begin // show form and select form if NewUnitInfo.Component<>nil then begin // show form - IDEWindowCreators.ShowForm(DefaultObjectInspectorName,false); MainIDE.DoShowDesignerFormOfCurrentSrc(False); end else begin MainIDE.DisplayState:= dsSource; @@ -6068,7 +6067,6 @@ begin MainIDE.DisplayState := dsForm; GlobalDesignHook.LookupRoot := NewComponent; TheControlSelection.AssignPersistent(NewComponent); - IDEWindowCreators.ShowForm(DefaultObjectInspectorName,false); end; // show new form