Merge pull request #1711 from AenBleidd/Issue1519Fixed

Fix issue #1519: MGR: Maximized window state is not restored on startup
This commit is contained in:
David Anderson 2016-11-14 22:47:28 -08:00 committed by GitHub
commit 252df23334
1 changed files with 5 additions and 0 deletions

View File

@ -1068,6 +1068,7 @@ bool CBOINCGUIApp::SetActiveGUI(int iGUISelection, bool bShowWindow) {
wxInt32 iLeft = 0;
wxInt32 iHeight = 0;
wxInt32 iWidth = 0;
bool bWindowMaximized = false;
// Create the new window
@ -1081,6 +1082,7 @@ 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);
m_pConfig->Read(wxT("WindowMaximized"), &bWindowMaximized, false);
// Guard against a rare situation where registry values are zero
if (iWidth < 50) iWidth = 800;
if (iHeight < 50) iHeight = 600;
@ -1188,6 +1190,9 @@ bool CBOINCGUIApp::SetActiveGUI(int iGUISelection, bool bShowWindow) {
if (m_pFrame->IsIconized()) {
m_pFrame->Maximize(false);
}
else if (BOINC_ADVANCEDGUI == iGUISelection && bWindowMaximized) {
m_pFrame->Maximize();
}
m_pFrame->Raise();
#ifdef __WXMSW__