From 1fac303fd69b36799852c359490efc176ebe3bc1 Mon Sep 17 00:00:00 2001 From: Rom Walton Date: Thu, 3 Feb 2005 19:11:35 +0000 Subject: [PATCH] *** empty log message *** svn path=/trunk/boinc/; revision=5300 --- checkin_notes | 6 ++++++ client/win/win_screensaver.cpp | 28 +++++++++++++++------------- client/win/win_screensaver.h | 1 + 3 files changed, 22 insertions(+), 13 deletions(-) diff --git a/checkin_notes b/checkin_notes index cf08e4c841..77d261c00e 100755 --- a/checkin_notes +++ b/checkin_notes @@ -23922,6 +23922,12 @@ David 3 Feb 2005 Rom 3 Feb 2005 - Bug Fix: Fix a localization problem where the application version number was being localized when it shouldn't be. + - Bug Fix: The dwBlankTime variable is initialized at screensaver + startup instead of when BOINC is notified to start the screensaver. + This should fix the case where the blank time is longer than + the project cycle time. + client/win/ + win_screensaver.cpp, .h clientgui/ ViewWork.cpp diff --git a/client/win/win_screensaver.cpp b/client/win/win_screensaver.cpp index c333e3371f..9d13cd539d 100755 --- a/client/win/win_screensaver.cpp +++ b/client/win/win_screensaver.cpp @@ -139,6 +139,7 @@ CScreensaver::CScreensaver() m_bBOINCCoreNotified = FALSE; m_bResetCoreState = TRUE; m_dwBOINCTimerCounter = 0; + m_dwBlankTime = 0; m_bBOINCConfigChecked = FALSE; m_bBOINCStartupConfigured = FALSE; @@ -155,6 +156,7 @@ CScreensaver::CScreensaver() HRESULT CScreensaver::Create( HINSTANCE hInstance ) { HRESULT hr; + BOOL bReturnValue; m_hInstance = hInstance; @@ -171,6 +173,17 @@ HRESULT CScreensaver::Create( HINSTANCE hInstance ) EnumMonitors(); + // Retrieve the blank screen timeout + // make sure you check return value of registry queries + // in case the item in question doesn't happen to exist. + bReturnValue = UtilGetRegKey( REG_BLANK_TIME, m_dwBlankTime ); + if ( bReturnValue < 0 ) m_dwBlankTime = 0; + + // Calculate the estimated blank time by adding the current time + // and and the user specified time which is in minutes + m_dwBlankTime = time(0) + (m_dwBlankTime * 60); + + // Create the screen saver window(s) if( m_SaverMode == sm_preview || m_SaverMode == sm_test || @@ -275,7 +288,6 @@ VOID CScreensaver::StartupBOINC() { TCHAR szCurrentWindowStation[MAX_PATH]; TCHAR szCurrentDesktop[MAX_PATH]; - DWORD dwBlankTime; BOOL bReturnValue; int iReturnValue; @@ -310,22 +322,12 @@ VOID CScreensaver::StartupBOINC() } } - // Retrieve the blank screen timeout - // make sure you check return value of registry queries - // in case the item in question doesn't happen to exist. - bReturnValue = UtilGetRegKey( REG_BLANK_TIME, dwBlankTime ); - if ( bReturnValue < 0 ) dwBlankTime = 0; - - // Calculate the estimated blank time by adding the current time - // and and the user specified time which is in minutes - dwBlankTime = time(0) + (dwBlankTime * 60); - // Tell the boinc client to start the screen saver BOINCTRACE( _T("CScreensaver::StartupBOINC - Calling set_screensaver_mode - WindowStation = '%s', Desktop = '%s', BlankTime = '%d'.\n"), - szCurrentWindowStation, szCurrentDesktop, dwBlankTime + szCurrentWindowStation, szCurrentDesktop, m_dwBlankTime ); - iReturnValue = rpc.set_screensaver_mode(true, szCurrentWindowStation, szCurrentDesktop, dwBlankTime); + iReturnValue = rpc.set_screensaver_mode(true, szCurrentWindowStation, szCurrentDesktop, m_dwBlankTime); BOINCTRACE(_T("CScreensaver::StartupBOINC - set_screensaver_mode iReturnValue = '%d'\n"), iReturnValue); // We have now notified the boinc client diff --git a/client/win/win_screensaver.h b/client/win/win_screensaver.h index 0e9c941236..c8f650d74b 100644 --- a/client/win/win_screensaver.h +++ b/client/win/win_screensaver.h @@ -168,6 +168,7 @@ protected: BOOL m_bBOINCCoreNotified; BOOL m_bResetCoreState; DWORD m_dwBOINCTimerCounter; + DWORD m_dwBlankTime; BOOL m_bBOINCConfigChecked; BOOL m_bBOINCStartupConfigured;