From 7948025bdebe365923e70217b9b9b5c971f7ff77 Mon Sep 17 00:00:00 2001 From: Vitalii Koshura Date: Mon, 7 Nov 2016 04:25:07 +0200 Subject: [PATCH] Fix issue #1519: MGR: Maximized window state is not restored on startup --- clientgui/BOINCGUIApp.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/clientgui/BOINCGUIApp.cpp b/clientgui/BOINCGUIApp.cpp index aed7d9e938..7c36ffd9bc 100644 --- a/clientgui/BOINCGUIApp.cpp +++ b/clientgui/BOINCGUIApp.cpp @@ -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__