From 1ed1ed95f26f88b15304b1f2ec75241393e21b7d Mon Sep 17 00:00:00 2001 From: Charlie Fenton Date: Thu, 19 Nov 2009 10:13:24 +0000 Subject: [PATCH] Mac MGR: don't show exit confirmation dialog if shutting down or restarting system svn path=/trunk/boinc/; revision=19646 --- checkin_notes | 7 +++++++ clientgui/BOINCGUIApp.cpp | 29 +++++++++-------------------- 2 files changed, 16 insertions(+), 20 deletions(-) diff --git a/checkin_notes b/checkin_notes index cdd8adbca7..ae2a7c0793 100644 --- a/checkin_notes +++ b/checkin_notes @@ -9363,3 +9363,10 @@ Charlie 18 Nov 2009 mac_build/ boinc.xcodeproj/ project.pbxproj + +Charlie 19 Nov 2009 + - Mac MGR: fix bug - don't show exit confirmation dialog if shutting + down or restarting system. + + clientgui/ + BOINCGUIApp.cpp diff --git a/clientgui/BOINCGUIApp.cpp b/clientgui/BOINCGUIApp.cpp index d17ad59a62..8a04f64223 100644 --- a/clientgui/BOINCGUIApp.cpp +++ b/clientgui/BOINCGUIApp.cpp @@ -72,8 +72,7 @@ bool s_bSkipExitConfirmation = false; OSErr QuitAppleEventHandler( const AppleEvent *appleEvt, AppleEvent* reply, UInt32 refcon ) { DescType senderType; Size actualSize; - ProcessSerialNumber SenderPSN, ourPSN; - Boolean isSame; + ProcessSerialNumber SenderPSN; ProcessInfoRec pInfo; FSSpec fileSpec; OSStatus anErr; @@ -89,28 +88,18 @@ OSErr QuitAppleEventHandler( const AppleEvent *appleEvt, AppleEvent* reply, UInt &senderType, &SenderPSN, sizeof(SenderPSN), &actualSize); if (anErr == noErr) { - - GetCurrentProcess(&ourPSN); + pInfo.processInfoLength = sizeof( ProcessInfoRec ); + pInfo.processName = NULL; + pInfo.processAppSpec = &fileSpec; - anErr = SameProcess(&SenderPSN, &ourPSN, &isSame); + anErr = GetProcessInformation(&SenderPSN, &pInfo); - if (anErr == noErr) { - if (!isSame) { - - pInfo.processInfoLength = sizeof( ProcessInfoRec ); - pInfo.processName = NULL; - pInfo.processAppSpec = &fileSpec; - - anErr = GetProcessInformation(&SenderPSN, &pInfo); - - // Consider a Quit command from our Dock menu as coming from this application - if (pInfo.processSignature != 'dock') { - s_bSkipExitConfirmation = true; // Not from our app, our dock icon or our taskbar icon - wxGetApp().ExitMainLoop(); // Prevents wxMac from issuing events to closed frames - } + // Consider a Quit command from our Dock menu as coming from this application + if ( (pInfo.processSignature != 'dock') && (pInfo.processSignature != 'BNC!') ) { + s_bSkipExitConfirmation = true; // Not from our app, our dock icon or our taskbar icon + wxGetApp().ExitMainLoop(); // Prevents wxMac from issuing events to closed frames } } - } return wxGetApp().MacHandleAEQuit((AppleEvent*)appleEvt, reply); }