Fix issue #1519: MGR: Maximized window state is not restored on startup

This commit is contained in:
Vitalii Koshura 2016-11-07 04:25:07 +02:00 committed by Vitalii Koshura
parent eed66cc916
commit 7948025bde
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);
}
if (BOINC_ADVANCEDGUI == iGUISelection && bWindowMaximized) {
m_pFrame->Maximize();
}
m_pFrame->Raise();
#ifdef __WXMSW__