From 7948025bdebe365923e70217b9b9b5c971f7ff77 Mon Sep 17 00:00:00 2001 From: Vitalii Koshura Date: Mon, 7 Nov 2016 04:25:07 +0200 Subject: [PATCH 1/2] 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__ From d8a82bbc0e0ab380f16f34549716ac5ea91defb4 Mon Sep 17 00:00:00 2001 From: Vitalii Koshura Date: Tue, 8 Nov 2016 12:28:22 +0200 Subject: [PATCH 2/2] Fix issue #1519: MGR: Maximized window state is not restored on startup. Fix 'if' statement. --- clientgui/BOINCGUIApp.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clientgui/BOINCGUIApp.cpp b/clientgui/BOINCGUIApp.cpp index 7c36ffd9bc..5902989b71 100644 --- a/clientgui/BOINCGUIApp.cpp +++ b/clientgui/BOINCGUIApp.cpp @@ -1190,7 +1190,7 @@ bool CBOINCGUIApp::SetActiveGUI(int iGUISelection, bool bShowWindow) { if (m_pFrame->IsIconized()) { m_pFrame->Maximize(false); } - if (BOINC_ADVANCEDGUI == iGUISelection && bWindowMaximized) { + else if (BOINC_ADVANCEDGUI == iGUISelection && bWindowMaximized) { m_pFrame->Maximize(); } m_pFrame->Raise();