Commit 1ed1ed95 authored by Charlie Fenton's avatar Charlie Fenton

Mac MGR: don't show exit confirmation dialog if shutting down or restarting system

svn path=/trunk/boinc/; revision=19646
parent a8a393b2
......@@ -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
......@@ -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);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment