diff --git a/clientgui/BOINCGUIApp.cpp b/clientgui/BOINCGUIApp.cpp index 5593728fcb..097bf04bfe 100644 --- a/clientgui/BOINCGUIApp.cpp +++ b/clientgui/BOINCGUIApp.cpp @@ -984,6 +984,9 @@ bool CBOINCGUIApp::SetActiveGUI(int iGUISelection, bool bShowWindow) { m_pConfig->Read(wxT("XPos"), &iLeft, 30); m_pConfig->Read(wxT("Width"), &iWidth, 800); m_pConfig->Read(wxT("Height"), &iHeight, 600); + // Guard against a rare situation where registry values are zero + if (iWidth < 50) iWidth = 800; + if (iHeight < 50) iHeight = 600; } else { m_pConfig->SetPath(wxT("/Simple")); m_pConfig->Read(wxT("YPos"), &iTop, 30); diff --git a/clientgui/DlgEventLog.cpp b/clientgui/DlgEventLog.cpp index d1756eb81c..440907a58c 100644 --- a/clientgui/DlgEventLog.cpp +++ b/clientgui/DlgEventLog.cpp @@ -763,6 +763,9 @@ void CDlgEventLog::GetWindowDimensions( wxPoint& position, wxSize& size ) { pConfig->Read(wxT("Width"), &iWidth, 640); pConfig->Read(wxT("Height"), &iHeight, 480); + // Guard against a rare situation where registry values are zero + if (iWidth < 50) iWidth = 640; + if (iHeight < 50) iHeight = 480; position.y = iTop; position.x = iLeft; size.x = iWidth; diff --git a/clientgui/DlgItemProperties.cpp b/clientgui/DlgItemProperties.cpp index b33e3d784a..bf572a018e 100644 --- a/clientgui/DlgItemProperties.cpp +++ b/clientgui/DlgItemProperties.cpp @@ -129,6 +129,10 @@ bool CDlgItemProperties::RestoreState() { pConfig->Read(wxT("Width"), &iWidth, wxDefaultCoord); pConfig->Read(wxT("Height"), &iHeight, wxDefaultCoord); + // Guard against a rare situation where registry values are zero + if ((iWidth < 50) && (iWidth != wxDefaultCoord)) iWidth = wxDefaultCoord; + if ((iHeight < 50) && (iHeight != wxDefaultCoord)) iHeight = wxDefaultCoord; + #ifndef __WXMAC__ // Set size to saved values or defaults if no saved values SetSize(iWidth, iHeight); diff --git a/clientgui/sg_DlgMessages.cpp b/clientgui/sg_DlgMessages.cpp index 5c3f15cc65..f9b584f614 100644 --- a/clientgui/sg_DlgMessages.cpp +++ b/clientgui/sg_DlgMessages.cpp @@ -597,6 +597,10 @@ void CDlgMessages::RestoreWindowDimensions() { pConfig->Read(wxT("WindowIconized"), &bWindowIconized, false); pConfig->Read(wxT("WindowMaximized"), &bWindowMaximized, false); + // Guard against a rare situation where registry values are zero + if (iWidth < 50) iWidth = 640; + if (iHeight < 50) iHeight = 480; + #ifndef __WXMAC__ // If either co-ordinate is less then 0 then set it equal to 0 to ensure