diff --git a/fix-object-inspector-visible.patch b/fix-object-inspector-visible.patch new file mode 100644 index 0000000..aafe855 --- /dev/null +++ b/fix-object-inspector-visible.patch @@ -0,0 +1,108 @@ +From: PragmaticLinux +Date: 2022-04-30 22:41:34 +0200 +Subject: Makes sure the Object Inspector is visible after the first install +References: boo#1197651 +Upstream: merged https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/39328 + +With a properly configured system (make, gdb, fpc, fppkg, etc.) Lazarus skips showing +the setup dialog, when you first start Lazarus after installation. This is correct. +However, in this case the Object Inspector window does not show. This patch fixes +this problem. + +--- + ide/main.pp | 26 +++++++++++++++++--------- + 1 file changed, 17 insertions(+), 9 deletions(-) + +Index: lazarus/ide/main.pp +=================================================================== +--- lazarus.orig/ide/main.pp ++++ lazarus/ide/main.pp +@@ -649,6 +649,7 @@ type + FFixingGlobalComponentLock: integer; + OldCompilerFilename, OldLanguage: String; + OIChangedTimer: TIdleTimer; ++ FEnvOptsCfgExisted: boolean; // tracks if a local or user specific environment options configuration file existed + + FIdentifierWordCompletion: TSourceEditorWordCompletion; + FIdentifierWordCompletionWordList: TStringList; +@@ -1199,7 +1200,6 @@ procedure TMainIDE.LoadGlobalOptions; + end; + + var +- EnvOptsCfgExisted: boolean; + s, LastCalled: String; + OldVer: String; + NowVer: String; +@@ -1212,7 +1212,6 @@ begin + + with EnvironmentOptions do + begin +- EnvOptsCfgExisted := FileExistsCached(GetDefaultConfigFilename); + OnBeforeRead := @EnvironmentOptionsBeforeRead; + OnBeforeWrite := @EnvironmentOptionsBeforeWrite; + OnAfterWrite := @EnvironmentOptionsAfterWrite; +@@ -1300,8 +1299,8 @@ begin + + OldVer:=EnvironmentOptions.OldLazarusVersion; + NowVer:=GetLazarusVersionString; +- //debugln(['TMainIDE.LoadGlobalOptions ',EnvOptsCfgExisted,' diff=',OldVer<>NowVer,' Now=',NowVer,' Old=',OldVer,' Comp=',CompareLazarusVersion(NowVer,OldVer)]); +- if EnvOptsCfgExisted and (OldVer<>NowVer) then ++ //debugln(['TMainIDE.LoadGlobalOptions ',FEnvOptsCfgExisted,' diff=',OldVer<>NowVer,' Now=',NowVer,' Old=',OldVer,' Comp=',CompareLazarusVersion(NowVer,OldVer)]); ++ if FEnvOptsCfgExisted and (OldVer<>NowVer) then + begin + IsUpgrade:=CompareLazarusVersion(NowVer,OldVer)>0; + if OldVer='' then +@@ -1387,7 +1386,6 @@ var + CfgCache: TPCTargetConfigCache; + OldLazDir: String; + Note: string; +- OI: TSimpleWindowLayout; + ConfigFile: string; + begin + {$IFDEF DebugSearchFPCSrcThread} +@@ -1466,10 +1464,6 @@ 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 +@@ -1510,6 +1504,9 @@ begin + // setup macros before loading options + MainBuildBoss.SetupTransferMacros; + ++ // set flag to track if a local or user specific environment options configuration file existed ++ FEnvOptsCfgExisted := FileExistsCached(EnvironmentOptions.GetDefaultConfigFilename); ++ + // load options + CreatePrimaryConfigPath; + StartProtocol; +@@ -2127,6 +2124,8 @@ begin + end; + + procedure TMainIDE.SetupObjectInspector; ++var ++ OIWindowLayout: TSimpleWindowLayout; + begin + IDECmdScopeObjectInspectorOnly.AddWindowClass(TObjectInspectorDlg); + +@@ -2135,6 +2134,15 @@ begin + + ShowAnchorDesigner:=@mnuViewAnchorEditorClicked; + ShowTabOrderEditor:=@mnuViewTabOrderClicked; ++ ++ // always show the object inspector in case no local or user specific environment ++ // options configuration file existed ++ if not FEnvOptsCfgExisted then ++ begin ++ OIWindowLayout := IDEWindowCreators.SimpleLayoutStorage.ItemByFormID(DefaultObjectInspectorName); ++ if OIWindowLayout <> nil then ++ OIWindowLayout.Visible := True; ++ end; + end; + + procedure TMainIDE.SetupFormEditor; diff --git a/lazarus.changes b/lazarus.changes index 06c2839..f775563 100644 --- a/lazarus.changes +++ b/lazarus.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Sat Apr 30 20:57:54 UTC 2022 - PragmaticLinux + +- Add patch to fix Object Inspector visibility: + * fix-object-inspector-visible.patch - boo#1197651 + ------------------------------------------------------------------- Sat Apr 23 10:57:00 UTC 2022 - PragmaticLinux diff --git a/lazarus.spec b/lazarus.spec index 1e3bf35..f9f6b20 100644 --- a/lazarus.spec +++ b/lazarus.spec @@ -34,6 +34,8 @@ Source90: %{name}-rpmlintrc Patch0: %{name}-Makefile_patch.diff # PATCH-FIX-OPENSUSE lazarus.desktop.patch -- Fix desktop file Patch1: lazarus.desktop.patch +# PATCH-FIX-UPSTREAM fix-object-inspector-visible.patch boo#1197651 +Patch2: fix-object-inspector-visible.patch BuildRequires: dos2unix BuildRequires: fdupes BuildRequires: fpc >= 3.0.0