From 9fc1e29b31fc378bec1f2f772f677136153e3a38 Mon Sep 17 00:00:00 2001 From: Charlie Fenton Date: Tue, 5 Apr 2005 11:48:52 +0000 Subject: [PATCH] *** empty log message *** svn path=/trunk/boinc/; revision=5778 --- api/x_opengl.C | 35 ++++++++++++++++++++++---- checkin_notes | 8 ++++++ mac_build/boinc.pbproj/project.pbxproj | 7 ++++++ 3 files changed, 45 insertions(+), 5 deletions(-) diff --git a/api/x_opengl.C b/api/x_opengl.C index 2ca26ea047..827fb29cec 100644 --- a/api/x_opengl.C +++ b/api/x_opengl.C @@ -17,6 +17,11 @@ // or write to the Free Software Foundation, Inc., // 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +#ifdef __APPLE_CC__ +#include +#endif + #include #include #include @@ -127,6 +132,10 @@ static void maybe_render() { } } +void CloseWindow() { + set_mode(MODE_HIDE_GRAPHICS); +} + static void make_new_window(int mode) { if ( (mode != MODE_WINDOW) && (mode != MODE_FULLSCREEN) ) { // nothing to be done here @@ -155,6 +164,16 @@ static void make_new_window(int mode) { if (mode == MODE_FULLSCREEN) { glutFullScreen(); } +#ifdef __APPLE_CC__ + else + SetSystemUIMode(kUIModeAllHidden, 0); // Hide Menu Bar + + glutWMCloseFunc(CloseWindow); // Enable the window's close box + + ProcessSerialNumber myProcess; + GetCurrentProcess(&myProcess); + SetFrontProcess(&myProcess); // Bring ourselves to the front +#endif return; } @@ -281,12 +300,18 @@ void restart() { // if we are standalone and glut was initialized, // we assume user pressed 'close', and we exit the app // - if (boinc_is_standalone() && glut_is_initialized ) { - app_debug_msg("Assuming user pressed 'close'... means we're exiting now.\n"); - if (boinc_delete_file(LOCKFILE) != 0) { + // + if (glut_is_initialized ) { + if (boinc_is_standalone()) + app_debug_msg("Assuming user pressed 'close'... means we're exiting now.\n"); +#ifdef __APPLE_CC__ + else + app_debug_msg("Assuming user pressed 'quit'... means we're exiting now.\n"); +#endif + if (boinc_delete_file(LOCKFILE) != 0) { perror ("Failed to remove lockfile..\n"); - } - return; + } + return; } // re-install the exit-handler to catch glut's notorious exits()... diff --git a/checkin_notes b/checkin_notes index 2c63a5456d..9ab9bd0234 100755 --- a/checkin_notes +++ b/checkin_notes @@ -26689,3 +26689,11 @@ Rom 5 April 2005 client/win/ win_screensaver.cpp,h + +Charlie 5 April 2005 + Mac: Enabled close box on science application graphics, handle Quit properly + using Bernd's suggestions. Hide GLUT menu bar. Bring application to + front when "Show Graphics" is selected in BOINC Manager. + + api/ + x_opengl.C diff --git a/mac_build/boinc.pbproj/project.pbxproj b/mac_build/boinc.pbproj/project.pbxproj index b6c72e2a95..f96d70e75f 100755 --- a/mac_build/boinc.pbproj/project.pbxproj +++ b/mac_build/boinc.pbproj/project.pbxproj @@ -1610,6 +1610,7 @@ DD40823807D304F000163EF5 = { buildActionMask = 2147483647; files = ( + DD539EFB08014FF8002D46D4, ); isa = PBXFrameworksBuildPhase; runOnlyForDeploymentPostprocessing = 0; @@ -2019,6 +2020,12 @@ settings = { }; }; + DD539EFB08014FF8002D46D4 = { + fileRef = 20286C33FDCF999611CA2CEA; + isa = PBXBuildFile; + settings = { + }; + }; DD5EF07007C5B329007CCE8D = { fileEncoding = 30; isa = PBXFileReference;