- MGR: Tweak the z-order of BOINC Manager owned windows a little bit.

Image a case where BOINC Manager and the BOINC Manager event log
        live side-by-side or only slightly overlapped, and the user wants
        to use a full screen/maximized window.  If the bring the BOINC
        manager window back into focus while that app is still running
        make sure the event log comes forward as well.  The event log
        should appear behind the main window in the case they are
        overlapped.
        
    clientgui/
        BOINCGUIApp.cpp, .h

svn path=/trunk/boinc/; revision=25129
This commit is contained in:
Rom Walton 2012-01-23 19:30:51 +00:00
parent 86dd953c06
commit 68ccd1e611
3 changed files with 37 additions and 8 deletions

View File

@ -890,3 +890,16 @@ David 22 Jan 2012
client/
cpu_sched.cpp
Rom 23 Jan 2012
- MGR: Tweak the z-order of BOINC Manager owned windows a little bit.
Image a case where BOINC Manager and the BOINC Manager event log
live side-by-side or only slightly overlapped, and the user wants
to use a full screen/maximized window. If the bring the BOINC
manager window back into focus while that app is still running
make sure the event log comes forward as well. The event log
should appear behind the main window in the case they are
overlapped.
clientgui/
BOINCGUIApp.cpp, .h

View File

@ -60,6 +60,7 @@ IMPLEMENT_APP(CBOINCGUIApp)
IMPLEMENT_DYNAMIC_CLASS(CBOINCGUIApp, wxApp)
BEGIN_EVENT_TABLE (CBOINCGUIApp, wxApp)
EVT_ACTIVATE_APP(CBOINCGUIApp::OnActivateApp)
EVT_RPC_FINISHED(CBOINCGUIApp::OnRPCFinished)
END_EVENT_TABLE ()
@ -787,6 +788,17 @@ int CBOINCGUIApp::IdleTrackerDetach() {
}
void CBOINCGUIApp::OnActivateApp(wxActivateEvent& event) {
if (event.GetActive()) {
if (m_pEventLog && !m_pEventLog->IsIconized()) {
m_pEventLog->Raise();
}
m_pFrame->Raise();
}
event.Skip();
}
void CBOINCGUIApp::OnRPCFinished( CRPCFinishedEvent& event ) {
CMainDocument* pDoc = wxGetApp().GetDocument();
@ -839,7 +851,7 @@ int CBOINCGUIApp::StartBOINCDefaultScreensaverTest() {
// Display the Event Log, it is a modeless dialog not owned by any
// other UI element.
void CBOINCGUIApp::DisplayEventLog(bool bShowWindow) {
if (m_pEventLog ) {
if (m_pEventLog) {
if (bShowWindow) {
if (m_pEventLog->IsIconized()) {
m_pEventLog->Iconize(false);
@ -991,17 +1003,20 @@ bool CBOINCGUIApp::SetActiveGUI(int iGUISelection, bool bShowWindow) {
}
// Show the new frame if needed
if (m_pFrame && !m_pFrame->IsShown() && bShowWindow) {
m_pFrame->Show();
m_pFrame->Raise();
if (m_pFrame && bShowWindow) {
if (m_pEventLog) {
m_pEventLog->Show();
m_pEventLog->Raise();
#ifdef __WXMSW__
::SetForegroundWindow((HWND)m_pFrame->GetHWND());
::SetForegroundWindow((HWND)m_pEventLog->GetHWND());
#endif
}
}
// Raise the frame to the top of the Z order if needed
if (m_pFrame && m_pFrame->IsShown() && bShowWindow) {
if (!m_pFrame->IsShown()) {
m_pFrame->Show();
}
m_pFrame->Raise();
#ifdef __WXMSW__
::SetForegroundWindow((HWND)m_pFrame->GetHWND());
#endif

View File

@ -168,6 +168,7 @@ public:
bool SetActiveGUI(int iGUISelection, bool bShowWindow = true);
void OnActivateApp( wxActivateEvent& event );
void OnRPCFinished( CRPCFinishedEvent& event );
int ConfirmExit();