← Back to team overview

kicad-developers team mailing list archive

[PATCH] At very first launch, old settings/config does not exist

 

KiCad read incorrect value for window position and it's size at very
first launch, which results in invisble/inaccessible window on Mac OSX.
Set correct default values for these settings fixes this issue.
And fix a typo in comment.
---
 common/eda_base_frame.cpp | 8 ++++----
 kicad/mainframe.cpp       | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/common/eda_base_frame.cpp b/common/eda_base_frame.cpp
index 8ca1886ef..1c015a5fe 100644
--- a/common/eda_base_frame.cpp
+++ b/common/eda_base_frame.cpp
@@ -273,16 +273,16 @@ void EDA_BASE_FRAME::LoadSettings( wxConfigBase* aCfg )
     wxString baseCfgName = ConfigBaseName();
 
     wxString text = baseCfgName + entryPosX;
-    aCfg->Read( text, &m_FramePos.x );
+    aCfg->Read( text, &m_FramePos.x, m_FramePos.x );
 
     text = baseCfgName + entryPosY;
-    aCfg->Read( text, &m_FramePos.y );
+    aCfg->Read( text, &m_FramePos.y, m_FramePos.y );
 
     text = baseCfgName + entrySizeX;
-    aCfg->Read( text, &m_FrameSize.x, wxDefaultSize.x );
+    aCfg->Read( text, &m_FrameSize.x, m_FrameSize.x );
 
     text = baseCfgName + entrySizeY;
-    aCfg->Read( text, &m_FrameSize.y, wxDefaultSize.x );
+    aCfg->Read( text, &m_FrameSize.y, m_FrameSize.y );
 
     text = baseCfgName + entryMaximized;
     aCfg->Read( text, &maximized, 0 );
diff --git a/kicad/mainframe.cpp b/kicad/mainframe.cpp
index c4587fd2d..21d6fda52 100644
--- a/kicad/mainframe.cpp
+++ b/kicad/mainframe.cpp
@@ -67,7 +67,7 @@ KICAD_MANAGER_FRAME::KICAD_MANAGER_FRAME( wxWindow* parent,
     icon.CopyFromBitmap( KiBitmap( icon_kicad_xpm ) );
     SetIcon( icon );
 
-    // Give the last sise and pos to main window
+    // Give the last size and pos to main window
     LoadSettings( config() );
     SetSize( m_FramePos.x, m_FramePos.y, m_FrameSize.x, m_FrameSize.y );
 

Follow ups