Mac: Fix bugs when user chooses Quit from menubar icon menu and then cancels in confirmation dialog

svn path=/trunk/boinc/; revision=13007
This commit is contained in:
Charlie Fenton 2007-06-24 10:56:11 +00:00
parent dbfb00570e
commit ad9df1c691
1 changed files with 8 additions and 1 deletions

View File

@ -51,7 +51,7 @@
#include "sg_BoincSimpleGUI.h"
#include "DlgGenericMessage.h"
static bool s_bSkipExitConfirmation;
static bool s_bSkipExitConfirmation = false;
#ifdef __WXMSW__
EXTERN_C BOOL IsBOINCServiceInstalled();
@ -1045,6 +1045,7 @@ int CBOINCGUIApp::ConfirmExit() {
ProcessSerialNumber psn;
GetCurrentProcess(&psn);
bool wasVisible = IsProcessVisible(&psn);
SetFrontProcess(&psn); // Shows process if hidden
#endif
@ -1064,8 +1065,14 @@ int CBOINCGUIApp::ConfirmExit() {
if (dlg.m_DialogDisableMessage->GetValue()) {
m_iDisplayExitWarning = 0;
}
s_bSkipExitConfirmation = true; // Don't ask twice (only affects Mac)
return 1;
}
#ifdef __WXMAC__
if (!wasVisible) {
ShowHideProcess(&psn, false);
}
#endif
return 0; // User cancelled exit
}