From 813409168bd8ddce377e5d87baca8a28b6f4caad Mon Sep 17 00:00:00 2001 From: Rom Walton Date: Tue, 7 Aug 2012 21:43:30 +0000 Subject: [PATCH] - WINSCR: Fix problem with the screensaver needlessly cycling in preview mode. Ugh. svn path=/trunk/boinc/; revision=25990 --- checkin_notes | 7 +++++++ clientscr/screensaver_win.cpp | 23 ++++++++++++++++++++--- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/checkin_notes b/checkin_notes index b7474a3cea..bc8e901963 100644 --- a/checkin_notes +++ b/checkin_notes @@ -5323,3 +5323,10 @@ Rom 7 Aug 2012 api/ Makefile.am + +Rom 7 Aug 2012 + - WINSCR: Fix problem with the screensaver needlessly cycling in + preview mode. Ugh. + + clientscr/ + screensaver_win.cpp diff --git a/clientscr/screensaver_win.cpp b/clientscr/screensaver_win.cpp index 3aac54e825..6bb2e2d3e8 100644 --- a/clientscr/screensaver_win.cpp +++ b/clientscr/screensaver_win.cpp @@ -1359,6 +1359,21 @@ LRESULT CScreensaver::SaverProc( return 0; break; + case WM_CLOSE: + BOINCTRACE(_T("CScreensaver::SaverProc Received WM_CLOSE\n")); + DestroyWindow(hWnd); + return 0; + break; + + case WM_DESTROY: + BOINCTRACE(_T("CScreensaver::SaverProc Received WM_DESTROY\n")); + if (m_SaverMode == sm_preview || m_SaverMode == sm_test) { + ShutdownSaver(); + } + PostQuitMessage(0); + return 0; + break; + case WM_SYSCOMMAND: BOINCTRACE(_T("CScreensaver::SaverProc Received WM_SYSCOMMAND\n")); if (m_SaverMode == sm_full) { @@ -1394,14 +1409,15 @@ LRESULT CScreensaver::SaverProc( // All initialization messages have gone through. Allow // 500ms of idle time, then proceed with initialization. SetTimer(hWnd, 1, 500, NULL); + return 0; } else if (WM_INTERRUPTSAVER == uMsg) { BOINCTRACE(_T("CScreensaver::SaverProc Received WM_INTERRUPTSAVER\n")); - ShutdownSaver(); CloseWindow(hWnd); - DestroyWindow(hWnd); + ShutdownSaver(); PostQuitMessage(0); + return 0; } @@ -1538,12 +1554,13 @@ LRESULT CScreensaver::GenericSaverProc( // All initialization messages have gone through. Allow // 500ms of idle time, then proceed with initialization. SetTimer(hWnd, 1, 500, NULL); + return 0; } else if (WM_INTERRUPTSAVER == uMsg) { BOINCTRACE(_T("CScreensaver::GenericSaverProc Received WM_INTERRUPTSAVER\n")); CloseWindow(hWnd); - DestroyWindow(hWnd); + return 0; }