diff --git a/checkin_notes b/checkin_notes index e26c3e3b66..25c8619474 100755 --- a/checkin_notes +++ b/checkin_notes @@ -23075,11 +23075,19 @@ Rom 20 Jan 2005 NOTE: I need to talk to David about this a little bit, but I think it is doable. + - Bug Fix: Fix the screensaver load up problem where it was + taking 60 seconds before the first text was displayed. + + NOTE: This reintroduces a bug where the screensaver slows to + a crawl when boinc isn't running in the background. I + think I've figured out a solution to it, but I didn't get + the code written for this release. client/ client_state.C cs_prefs.C client/win hostinfo_win.cpp + win_screensaver.cpp, .h win_build/installerv2/ BOINC.ism diff --git a/client/win/win_screensaver.cpp b/client/win/win_screensaver.cpp index e48941493d..f98b3ef320 100755 --- a/client/win/win_screensaver.cpp +++ b/client/win/win_screensaver.cpp @@ -144,8 +144,6 @@ CScreensaver::CScreensaver() ZeroMemory( m_Monitors, sizeof(m_Monitors) ); m_dwNumMonitors = 0; - - m_tTimeTillNextContact = 0; } @@ -626,7 +624,7 @@ HRESULT CScreensaver::CreateSaverWindow() m_hWnd = pMonitorInfo->hWnd; SetTimer(pMonitorInfo->hWnd, 2, 500, NULL); - SetTimer(pMonitorInfo->hWnd, 3, 1000, NULL); + SetTimer(pMonitorInfo->hWnd, 3, 10000, NULL); } } } @@ -774,94 +772,89 @@ LRESULT CScreensaver::PrimarySaverProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPA m_bResetCoreState = FALSE; } - // Lets try and get the current status of the CC - if (time(0) > m_tTimeTillNextContact) + iReturnValue = rpc.get_screensaver_mode( iStatus ); + BOINCTRACE(_T("CScreensaver::PrimarySaverProc - get_screensaver_mode iReturnValue = '%d'\n"), iReturnValue); + if (0 != iReturnValue) { - iReturnValue = rpc.get_screensaver_mode( iStatus ); - BOINCTRACE(_T("CScreensaver::PrimarySaverProc - get_screensaver_mode iReturnValue = '%d'\n"), iReturnValue); - if (0 != iReturnValue) + // Attempt to reinitialize the RPC client and state + rpc.close(); + rpc.init( NULL ); + m_bResetCoreState = TRUE; + + if (!m_bBOINCConfigChecked) { - // Attempt to reinitialize the RPC client and state - rpc.close(); - rpc.init( NULL ); - m_bResetCoreState = TRUE; - - if (!m_bBOINCConfigChecked) - { - m_bBOINCConfigChecked = TRUE; - m_bBOINCStartupConfigured = IsConfigStartupBOINC(); - } - - if(m_bBOINCStartupConfigured) - { - m_bErrorMode = TRUE; - m_hrError = SCRAPPERR_BOINCNOTDETECTED; - } - else - { - m_bErrorMode = TRUE; - m_hrError = SCRAPPERR_BOINCNOTDETECTEDSTARTUP; - } - - m_bBOINCCoreNotified = FALSE; - m_tTimeTillNextContact = time(0) + (60 * 60); + m_bBOINCConfigChecked = TRUE; + m_bBOINCStartupConfigured = IsConfigStartupBOINC(); } - else - { - // Reset the error flags. - m_bErrorMode = FALSE; - m_hrError = 0; - if (m_bBOINCCoreNotified) + if(m_bBOINCStartupConfigured) + { + m_bErrorMode = TRUE; + m_hrError = SCRAPPERR_BOINCNOTDETECTED; + } + else + { + m_bErrorMode = TRUE; + m_hrError = SCRAPPERR_BOINCNOTDETECTEDSTARTUP; + } + + m_bBOINCCoreNotified = FALSE; + } + else + { + // Reset the error flags. + m_bErrorMode = FALSE; + m_hrError = 0; + + if (m_bBOINCCoreNotified) + { + switch (iStatus) { - switch (iStatus) - { - case SS_STATUS_ENABLED: - hwndBOINCGraphicsWindow = FindWindow( BOINC_WINDOW_CLASS_NAME, NULL ); - if ( NULL != hwndBOINCGraphicsWindow ) + case SS_STATUS_ENABLED: + hwndBOINCGraphicsWindow = FindWindow( BOINC_WINDOW_CLASS_NAME, NULL ); + if ( NULL != hwndBOINCGraphicsWindow ) + { + hwndForegroundWindow = GetForegroundWindow(); + if ( hwndForegroundWindow != hwndBOINCGraphicsWindow ) { + BOINCTRACE(_T("CScreensaver::PrimarySaverProc - Graphics Window Detected but NOT the foreground window, bringing window to foreground.\n")); + SetForegroundWindow(hwndBOINCGraphicsWindow); + hwndForegroundWindow = GetForegroundWindow(); if ( hwndForegroundWindow != hwndBOINCGraphicsWindow ) { - BOINCTRACE(_T("CScreensaver::PrimarySaverProc - Graphics Window Detected but NOT the foreground window, bringing window to foreground.\n")); - SetForegroundWindow(hwndBOINCGraphicsWindow); - - hwndForegroundWindow = GetForegroundWindow(); - if ( hwndForegroundWindow != hwndBOINCGraphicsWindow ) - { - BOINCTRACE(_T("CScreensaver::PrimarySaverProc - Graphics Window Detected but NOT the foreground window, bringing window to foreground. (Final Try)\n")); - // This may be needed on Windows 2000 or better machines - DWORD dwComponents = BSM_APPLICATIONS; - BroadcastSystemMessage( - BSF_ALLOWSFW, - &dwComponents, - WM_BOINCSFW, - NULL, - NULL - ); - } + BOINCTRACE(_T("CScreensaver::PrimarySaverProc - Graphics Window Detected but NOT the foreground window, bringing window to foreground. (Final Try)\n")); + // This may be needed on Windows 2000 or better machines + DWORD dwComponents = BSM_APPLICATIONS; + BroadcastSystemMessage( + BSF_ALLOWSFW, + &dwComponents, + WM_BOINCSFW, + NULL, + NULL + ); } } + } + break; + case SS_STATUS_BLANKED: + break; + case SS_STATUS_RESTARTREQUEST: + m_bBOINCCoreNotified = FALSE; + break; + case SS_STATUS_BOINCSUSPENDED: + m_bErrorMode = TRUE; + m_hrError = SCRAPPERR_BOINCSUSPENDED; + break; + case SS_STATUS_NOAPPSEXECUTING: + m_bErrorMode = TRUE; + m_hrError = SCRAPPERR_BOINCNOAPPSEXECUTING; + break; + case SS_STATUS_NOTGRAPHICSCAPABLE: + case SS_STATUS_NOGRAPHICSAPPSEXECUTING: + m_bErrorMode = TRUE; + m_hrError = SCRAPPERR_BOINCNOGRAPHICSAPPSEXECUTING; break; - case SS_STATUS_BLANKED: - break; - case SS_STATUS_RESTARTREQUEST: - m_bBOINCCoreNotified = FALSE; - break; - case SS_STATUS_BOINCSUSPENDED: - m_bErrorMode = TRUE; - m_hrError = SCRAPPERR_BOINCSUSPENDED; - break; - case SS_STATUS_NOAPPSEXECUTING: - m_bErrorMode = TRUE; - m_hrError = SCRAPPERR_BOINCNOAPPSEXECUTING; - break; - case SS_STATUS_NOTGRAPHICSCAPABLE: - case SS_STATUS_NOGRAPHICSAPPSEXECUTING: - m_bErrorMode = TRUE; - m_hrError = SCRAPPERR_BOINCNOGRAPHICSAPPSEXECUTING; - break; - } } } } diff --git a/client/win/win_screensaver.h b/client/win/win_screensaver.h index 393139c296..c7dcaf80df 100644 --- a/client/win/win_screensaver.h +++ b/client/win/win_screensaver.h @@ -168,8 +168,6 @@ protected: BOOL m_bResetCoreState; BOOL m_bBOINCConfigChecked; BOOL m_bBOINCStartupConfigured; - - time_t m_tTimeTillNextContact; }; #endif