diff --git a/checkin_notes b/checkin_notes index 6c0eb61dcc..37d509b6c5 100644 --- a/checkin_notes +++ b/checkin_notes @@ -1084,7 +1084,7 @@ Charlie 27 Jan 2012 clientgui/ BOINCTaskBar.cpp,.h mac/ - macSysMenu.cpp + MacSysMenu.cpp David 27 Jan 2012 - manager: in Disk View, try to make colors more distinct. @@ -2749,3 +2749,14 @@ David 17 Mar 2012 a 0.5-CPU GPU job and 1 4-CPU job client/ cpu_sched.cpp + +Charlie 18 Mar 2012 + - MGR: Fix a Mac-only bug which sometimes failed to show the snooze icon + after closing and opening the Manager windows. This was caused by + having a second instance of CTaskBarIcon. + + clientgui/ + BOINCBaseFrame.cpp + BOINCGUIApp.cpp,.h + mac/ + MacSysMenu.cpp diff --git a/clientgui/BOINCBaseFrame.cpp b/clientgui/BOINCBaseFrame.cpp index c5414de2fd..4f56dfb4b6 100644 --- a/clientgui/BOINCBaseFrame.cpp +++ b/clientgui/BOINCBaseFrame.cpp @@ -361,9 +361,6 @@ void CBOINCBaseFrame::OnExit(wxCommandEvent& WXUNUSED(event)) { SaveState(); // Under wxWidgets 2.8.0, the task bar icons must be deleted for app to exit its main loop -#ifdef __WXMAC__ - wxGetApp().DeleteMacSystemMenu(); -#endif wxGetApp().DeleteTaskBarIcon(); CDlgEventLog* eventLog = wxGetApp().GetEventLog(); diff --git a/clientgui/BOINCGUIApp.cpp b/clientgui/BOINCGUIApp.cpp index 874b6c5069..1d9ed7599b 100644 --- a/clientgui/BOINCGUIApp.cpp +++ b/clientgui/BOINCGUIApp.cpp @@ -419,13 +419,6 @@ bool CBOINCGUIApp::OnInit() { // Initialize the task bar icon - m_pTaskBarIcon = new CTaskBarIcon( - m_pSkinManager->GetAdvanced()->GetApplicationName(), - m_pSkinManager->GetAdvanced()->GetApplicationIcon(), - m_pSkinManager->GetAdvanced()->GetApplicationDisconnectedIcon(), - m_pSkinManager->GetAdvanced()->GetApplicationSnoozeIcon() - ); - wxASSERT(m_pTaskBarIcon); #ifdef __WXMAC__ m_pMacSystemMenu = new CMacSystemMenu( m_pSkinManager->GetAdvanced()->GetApplicationName(), @@ -434,7 +427,17 @@ bool CBOINCGUIApp::OnInit() { m_pSkinManager->GetAdvanced()->GetApplicationSnoozeIcon() ); wxASSERT(m_pMacSystemMenu); + m_pTaskBarIcon = (CTaskBarIcon*)m_pMacSystemMenu; +#else + m_pTaskBarIcon = new CTaskBarIcon( + m_pSkinManager->GetAdvanced()->GetApplicationName(), + m_pSkinManager->GetAdvanced()->GetApplicationIcon(), + m_pSkinManager->GetAdvanced()->GetApplicationDisconnectedIcon(), + m_pSkinManager->GetAdvanced()->GetApplicationSnoozeIcon() + ); + #endif + wxASSERT(m_pTaskBarIcon); // Startup the System Idle Detection code @@ -1253,21 +1256,18 @@ bool CBOINCGUIApp::IsModalDialogDisplayed() { } void CBOINCGUIApp::DeleteTaskBarIcon() { - if (m_pTaskBarIcon) { - delete m_pTaskBarIcon; - } - m_pTaskBarIcon = NULL; -} - #ifdef __WXMAC__ -void CBOINCGUIApp::DeleteMacSystemMenu() { - if (m_pMacSystemMenu) { + if (m_pMacSystemMenu) { delete m_pMacSystemMenu; } m_pMacSystemMenu = NULL; -} +#else + if (m_pTaskBarIcon) { + delete m_pTaskBarIcon; + } #endif - + m_pTaskBarIcon = NULL; +} // Prevent recursive entry of CMainDocument::RequestRPC() int CBOINCGUIApp::FilterEvent(wxEvent &event) { diff --git a/clientgui/BOINCGUIApp.h b/clientgui/BOINCGUIApp.h index e0cd490b6e..c64b7058b5 100644 --- a/clientgui/BOINCGUIApp.h +++ b/clientgui/BOINCGUIApp.h @@ -138,7 +138,6 @@ public: #ifdef __WXMAC__ CMacSystemMenu* GetMacSystemMenu() { return m_pMacSystemMenu; } - void DeleteMacSystemMenu(); int ShouldShutdownCoreClient() { return true; } #else int ShouldShutdownCoreClient() { return m_iShutdownCoreClient; } diff --git a/clientgui/mac/MacSysMenu.cpp b/clientgui/mac/MacSysMenu.cpp index afe926b548..2799d37389 100644 --- a/clientgui/mac/MacSysMenu.cpp +++ b/clientgui/mac/MacSysMenu.cpp @@ -363,7 +363,6 @@ pascal OSStatus SysMenuEventHandler( EventHandlerCallRef inHandlerCallRef, // Note that if the main window is open, CBOINCBaseFrame::OnExit() will be // called and SysMenuEventHandler() (i.e., this code) will not be called. if (commandID == wxID_EXIT) { - wxGetApp().DeleteMacSystemMenu(); wxGetApp().DeleteTaskBarIcon(); } return noErr ;