diff --git a/checkin_notes b/checkin_notes index 9ab9bd0234..d72e7cafb4 100755 --- a/checkin_notes +++ b/checkin_notes @@ -26697,3 +26697,18 @@ Charlie 5 April 2005 api/ x_opengl.C + +Rom 5 April 2005 + - Bug Fix: We stoped ack'ing the MODE_UNSUPPORTED from a science application + after a screensaver start request. Check for any graphics messages that + need to be processed from get_next_graphics_capable_app(). + - Bug Fix: Adjust the logic of get_next_graphics_capable_app() so that even + if the graphics mode was MODE_WINDOW or MODE_HIDE_GRAPHICS before the + start of the screensaver, we still factor in what it's current + graphics_mode_acked in case it has been changed to MODE_UNSUPPORTED + + client/ + app_graphics.C + client/win/ + win_screensaver.cpp + diff --git a/client/app_graphics.C b/client/app_graphics.C index 6dd88cb435..5c06a8d59b 100644 --- a/client/app_graphics.C +++ b/client/app_graphics.C @@ -68,7 +68,9 @@ void ACTIVE_TASK::check_graphics_mode_ack() { if (!app_client_shm.shm) return; if (app_client_shm.shm->graphics_reply.get_msg(buf)) { app_client_shm.decode_graphics_msg(buf, gm); - //BOINCTRACE("got graphics ack %s for %s\n", buf, result->name); +#ifdef SS_DEBUG + msg_printf(0, MSG_INFO, "got graphics ack %s for %s\n", buf, result->name); +#endif if (gm.mode != MODE_REREAD_PREFS) { graphics_mode_acked = gm.mode; } @@ -168,6 +170,15 @@ ACTIVE_TASK* CLIENT_STATE::get_next_graphics_capable_app() { ACTIVE_TASK *atp, *best_atp; PROJECT *p; + // check to see if the applications have changed the graphics ack + // since they were first started, this can happen if their is a + // failure to find the target desktop + // + for (i=0; icheck_graphics_mode_ack(); + } + // loop through all projects starting with the one at project_index // for (i=0; ischeduler_state != CPU_SCHED_SCHEDULED) continue; if (atp->result->project != p) continue; - if (!best_atp && atp->graphics_mode_before_ss == MODE_WINDOW) { + if (!best_atp && atp->graphics_mode_acked != MODE_UNSUPPORTED && + atp->graphics_mode_before_ss == MODE_WINDOW) { best_atp = atp; } - if (!best_atp && atp->graphics_mode_before_ss == MODE_HIDE_GRAPHICS) { + if (!best_atp && atp->graphics_mode_acked != MODE_UNSUPPORTED && + atp->graphics_mode_before_ss == MODE_HIDE_GRAPHICS) { best_atp = atp; } if (!best_atp && atp->graphics_mode_acked != MODE_UNSUPPORTED) { best_atp = atp; } if (best_atp) { - //msg_printf(0, MSG_INFO, "get_next_app: %s\n", best_atp->result->name); +#ifdef SS_DEBUG + msg_printf(0, MSG_INFO, "get_next_app: %s\n", best_atp->result->name); +#endif return atp; } } } - //msg_printf(0, MSG_INFO, "get_next_app: none\n"); +#ifdef SS_DEBUG + msg_printf(0, MSG_INFO, "get_next_app: none\n"); +#endif return NULL; } diff --git a/client/win/win_screensaver.cpp b/client/win/win_screensaver.cpp index 8ecbd35834..6a6fdefbed 100755 --- a/client/win/win_screensaver.cpp +++ b/client/win/win_screensaver.cpp @@ -1044,16 +1044,31 @@ DWORD WINAPI CScreensaver::DataManagementProc() HWND hwndForegroundWindow = NULL; int iReturnValue = 0; time_t tThreadCreateTime = 0; + bool bScreenSaverStarting = false; - BOINCTRACE(_T("CScreensaver::DataManagementProc - Display screen saver loading error\n")); + BOINCTRACE(_T("CScreensaver::DataManagementProc - Display screen saver loading message\n")); SetError( TRUE, SCRAPPERR_BOINCSCREENSAVERLOADING ); tThreadCreateTime = time(0); while( TRUE ) { + bScreenSaverStarting = (10 >= (time(0) - tThreadCreateTime)); + BOINCTRACE(_T("CScreensaver::DataManagementProc - Start Status = '%d', CoreNotified = '%d', ErrorMode = '%d', ErrorCode = '%x'\n"), m_iStatus, m_bCoreNotified, m_bErrorMode, m_hrError); + + // Lets try and get the current state of the CC + if ( m_bResetCoreState && m_bCoreNotified ) + { + iReturnValue = rpc.get_state( state ); + if ( 0 == iReturnValue ) + m_bResetCoreState = FALSE; + + BOINCTRACE(_T("CScreensaver::DataManagementProc - get_state iReturnValue = '%d'\n"), iReturnValue); + } + + iReturnValue = rpc.get_screensaver_mode( m_iStatus ); BOINCTRACE(_T("CScreensaver::DataManagementProc - get_screensaver_mode iReturnValue = '%d'\n"), iReturnValue); if (0 != iReturnValue) @@ -1069,10 +1084,13 @@ DWORD WINAPI CScreensaver::DataManagementProc() m_bBOINCStartupConfigured = IsConfigStartupBOINC(); } - if(m_bBOINCStartupConfigured) - SetError( TRUE, SCRAPPERR_BOINCNOTDETECTED ); - else - SetError( TRUE, SCRAPPERR_BOINCNOTDETECTEDSTARTUP ); + if ( !bScreenSaverStarting ) + { + if(m_bBOINCStartupConfigured) + SetError( TRUE, SCRAPPERR_BOINCNOTDETECTED ); + else + SetError( TRUE, SCRAPPERR_BOINCNOTDETECTEDSTARTUP ); + } m_bCoreNotified = FALSE; } @@ -1135,17 +1153,6 @@ DWORD WINAPI CScreensaver::DataManagementProc() BOINCTRACE(_T("CScreensaver::DataManagementProc - Checkpoint Status = '%d', CoreNotified = '%d', ErrorMode = '%d', ErrorCode = '%x'\n"), m_iStatus, m_bCoreNotified, m_bErrorMode, m_hrError); - // Lets try and get the current state of the CC - if ( m_bResetCoreState && m_bCoreNotified ) - { - iReturnValue = rpc.get_state( state ); - if ( 0 == iReturnValue ) - m_bResetCoreState = FALSE; - - BOINCTRACE(_T("CScreensaver::DataManagementProc - get_state iReturnValue = '%d'\n"), iReturnValue); - } - - GetError( bErrorMode, hrError, NULL, 0 ); if ( !m_bCoreNotified && !bErrorMode ) { @@ -1162,7 +1169,7 @@ DWORD WINAPI CScreensaver::DataManagementProc() } BOINCTRACE(_T("CScreensaver::SaverProc - End Status = '%d', CoreNotified = '%d', ErrorMode = '%d', ErrorCode = '%x'\n"), m_iStatus, m_bCoreNotified, m_bErrorMode, m_hrError); - if ( 10 >= (time(0) - tThreadCreateTime) ) + if ( bScreenSaverStarting ) Sleep( 1000 ); else Sleep( 10000 ); @@ -1241,9 +1248,7 @@ VOID CScreensaver::StartupBOINC() if ( 0 == iReturnValue ) m_bCoreNotified = TRUE; else - { SetError( TRUE, SCRAPPERR_BOINCNOTDETECTED ); - } } } } @@ -1367,7 +1372,7 @@ HRESULT CScreensaver::CreateSaverWindow() if( m_hWnd == NULL ) m_hWnd = pMonitorInfo->hWnd; - SetTimer(pMonitorInfo->hWnd, 2, 1000, NULL); + SetTimer(pMonitorInfo->hWnd, 2, 2000, NULL); } } } @@ -1833,7 +1838,8 @@ VOID CScreensaver::UpdateErrorBox() if( rcOld.left != rcNew.left || rcOld.top != rcNew.top ) { - InvalidateRect( hwnd, NULL, TRUE ); + InvalidateRect( hwnd, &rcOld, TRUE ); + InvalidateRect( hwnd, &rcNew, TRUE ); UpdateWindow( hwnd ); } } diff --git a/win_build/boinc_cli.vcproj b/win_build/boinc_cli.vcproj index 7c0c75b89c..c6c0e7585f 100644 --- a/win_build/boinc_cli.vcproj +++ b/win_build/boinc_cli.vcproj @@ -23,7 +23,7 @@ Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="../,../lib/,../api/,../RSAEuro/source/,../client/win/,../client" - PreprocessorDefinitions="WIN32;_DEBUG;_MT;_WINDOWS;_CONSOLE" + PreprocessorDefinitions="WIN32;_DEBUG;_MT;_WINDOWS;_CONSOLE;SS_DEBUG" MinimalRebuild="TRUE" BasicRuntimeChecks="3" RuntimeLibrary="3"