From fd1e7b33caa0e197f2740b195bddb460c147b70f Mon Sep 17 00:00:00 2001 From: Charlie Fenton Date: Mon, 23 Feb 2009 23:06:03 +0000 Subject: [PATCH] screensaver: Code consolidation, fix bug terminating default graphics app on screensaver exit svn path=/trunk/boinc/; revision=17339 --- checkin_notes | 7 +++++++ clientscr/screensaver.cpp | 19 ++++--------------- clientscr/screensaver_win.h | 1 + 3 files changed, 12 insertions(+), 15 deletions(-) diff --git a/checkin_notes b/checkin_notes index 861a87d527..100fc808d9 100644 --- a/checkin_notes +++ b/checkin_notes @@ -1956,3 +1956,10 @@ David 22 Feb 2009 client/ rr_sim.cpp work_fetch.cpp,h + +Charlie 22 Feb 2009 + - screensaver: Code consolidation, fix bug terminating default graphics + application on screensaver exit. + + clientscr/ + screensaver.cpp diff --git a/clientscr/screensaver.cpp b/clientscr/screensaver.cpp index f7416a6750..bb9804b5a0 100644 --- a/clientscr/screensaver.cpp +++ b/clientscr/screensaver.cpp @@ -249,14 +249,14 @@ int CScreensaver::terminate_screensaver(HANDLE& graphics_application, RESULT *wo int CScreensaver::terminate_screensaver(int& graphics_application, RESULT *worker_app) #endif { - if (!m_bScience_gfx_running) { - return 0; - } if (graphics_application) { // V6 Graphics kill_program(graphics_application); #ifdef __APPLE__ + if (!m_bScience_gfx_running) { + return 0; // Don't use gfx_switcher for default gfx app + } // For sandbox security, use gfx_switcher to launch gfx app // as user boinc_project and group boinc_project. int retval = 0; @@ -444,7 +444,6 @@ void *CScreensaver::DataManagementProc() while (true) { -#ifndef _WIN32 for (int i = 0; i < 4; i++) { // *** // *** Things that should be run frequently. @@ -463,7 +462,6 @@ void *CScreensaver::DataManagementProc() } boinc_sleep(0.25); } -#endif // *** // *** Things that should be run frequently. @@ -474,17 +472,8 @@ void *CScreensaver::DataManagementProc() if ((m_dwBlankScreen) && (time(0) > m_dwBlankTime)) { BOINCTRACE(_T("CScreensaver::DataManagementProc - Time to blank\n")); SetError(FALSE, SCRAPPERR_SCREENSAVERBLANKED); -#ifndef _WIN32 m_QuitDataManagementProc = true; -#else - if (m_hGraphicsApplication || graphics_app_result_ptr) { - terminate_screensaver(m_hGraphicsApplication, graphics_app_result_ptr); - graphics_app_result_ptr = NULL; - previous_result_ptr = NULL; - m_hGraphicsApplication = 0; - } - return 0; // Exit the thread -#endif + continue; // Exit the thread } BOINCTRACE(_T("CScreensaver::DataManagementProc - ErrorMode = '%d', ErrorCode = '%x'\n"), m_bErrorMode, m_hrError); diff --git a/clientscr/screensaver_win.h b/clientscr/screensaver_win.h index ba310c6c3f..2fb9070a63 100644 --- a/clientscr/screensaver_win.h +++ b/clientscr/screensaver_win.h @@ -208,6 +208,7 @@ protected: HANDLE m_hDataManagementThread; HANDLE m_hGraphicsApplication; BOOL m_bResetCoreState; + bool m_QuitDataManagementProc; bool m_bV5_GFX_app_is_running; int m_iLastResultShown; time_t m_tLastResultChangeTime;