From 6d31cb5666ae6def36857fa48bb58d46cfcf715f Mon Sep 17 00:00:00 2001 From: Rom Walton Date: Fri, 3 Dec 2004 00:54:30 +0000 Subject: [PATCH] *** empty log message *** svn path=/trunk/boinc/; revision=4718 --- checkin_notes | 12 ++++++++++++ client/win/win_screensaver.cpp | 14 ++++++++++++++ lib/gui_rpc_client.h | 2 ++ 3 files changed, 28 insertions(+) diff --git a/checkin_notes b/checkin_notes index 606232f5d3..63cd0310de 100755 --- a/checkin_notes +++ b/checkin_notes @@ -20572,3 +20572,15 @@ Bruce 2 Dec 2004 db_ops.inc ops/ db_form.inc + +Rom 2 Dec 2004 + - Bug Fix: On certain versions of Windows it might be necessary for the + screensaver to force the foreground window depending on the state in + which the screensaver was launched. This is the slightly less + aggressive way to do this. Ideally the active process is the screensaver + and so therefore can promote another process into the foreground. + + client/win/ + win_screensaver.cpp + lib/ + gui_rpc_client.h diff --git a/client/win/win_screensaver.cpp b/client/win/win_screensaver.cpp index 616fef196b..70bd8dcf4c 100755 --- a/client/win/win_screensaver.cpp +++ b/client/win/win_screensaver.cpp @@ -830,6 +830,20 @@ LRESULT CScreensaver::PrimarySaverProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPA { switch (iStatus) { + case SS_STATUS_ENABLED: + HWND hwndBOINCGraphicsWindow = NULL; + HWND hwndActiveWindow = NULL; + + hwndBOINCGraphicsWindow = FindWindow( BOINC_WINDOW_CLASS_NAME, NULL ); + if ( NULL != hwndBOINCGraphicsWindow ) + { + hwndActiveWindow = GetForegroundWindow(); + if ( hwndActiveWindow != hwndBOINCGraphicsWindow ) + { + SetForegroundWindow(hwndBOINCGraphicsWindow); + } + } + break; case SS_STATUS_RESTARTREQUEST: m_bBOINCCoreNotified = FALSE; break; diff --git a/lib/gui_rpc_client.h b/lib/gui_rpc_client.h index 92851025a9..137b3ddbf7 100644 --- a/lib/gui_rpc_client.h +++ b/lib/gui_rpc_client.h @@ -55,6 +55,8 @@ #define SS_STATUS_NOGRAPHICSAPPSEXECUTING 7 #define SS_STATUS_QUIT 8 +#define BOINC_WINDOW_CLASS_NAME "BOINC_app" + struct GUI_URL { std::string name; std::string description;