diff --git a/checkin_notes b/checkin_notes index 9b1e6d1d88..c37ab0fe2e 100644 --- a/checkin_notes +++ b/checkin_notes @@ -7334,3 +7334,10 @@ David 14 Oct 2010 client/ cs_apps.cpp cs_scheduler.cpp + +Rom 14 Oct 2010 + - MGR: Complete above changes for the Mac + + clientgui/ + BOINCGUIApp.cpp, .h + MainDocument.cpp diff --git a/clientgui/BOINCGUIApp.cpp b/clientgui/BOINCGUIApp.cpp index d4958d8ac6..0c9128ce8c 100644 --- a/clientgui/BOINCGUIApp.cpp +++ b/clientgui/BOINCGUIApp.cpp @@ -671,6 +671,16 @@ bool CBOINCGUIApp::DetectDuplicateInstance() { ::SetForegroundWindow(hWnd); return true; } +#endif +#ifdef __WXMAC__ + ProcessSerialNumber PSN; + int iInstanceID = wxGetApp().IsAnotherInstanceRunning(); + if (iInstanceID) { + // Bring other instance to the front and exit this instance + OSStatus err = GetProcessForPID(iInstanceID, &PSN); + if (!err) SetFrontProcess(&PSN); + return true; + } #endif return false; } diff --git a/clientgui/MainDocument.cpp b/clientgui/MainDocument.cpp index 98e9c9cdf4..71d40c342a 100644 --- a/clientgui/MainDocument.cpp +++ b/clientgui/MainDocument.cpp @@ -575,24 +575,9 @@ int CMainDocument::OnPoll() { if (IsComputerNameLocal(hostName)) { otherInstanceID = wxGetApp().IsAnotherInstanceRunning(); if (otherInstanceID) { - if (wxGetApp().IsMultipleInstancesOK()) { - if (!pFrame->SelectComputer(hostName, portNum, password, true)) { - wxCommandEvent event; - s_bSkipExitConfirmation = true; - pFrame->OnExit(event); // Exit if Select Computer dialog cancelled - } - } else { // (IsMultipleInstancesOK() == false) - // Bring other instance to the front and exit this instance - -#ifdef __WXMAC__ - ProcessSerialNumber otherInstancePSN; - OSStatus err; - - err = GetProcessForPID(otherInstanceID, &otherInstancePSN); - if (!err) SetFrontProcess(&otherInstancePSN); -#endif - wxCommandEvent event; + if (!pFrame->SelectComputer(hostName, portNum, password, true)) { s_bSkipExitConfirmation = true; + wxCommandEvent event; pFrame->OnExit(event); // Exit if Select Computer dialog cancelled } }