From 9dabd425a50ad348caf78f13fee5f74c6d94f188 Mon Sep 17 00:00:00 2001 From: crs Date: Fri, 21 Mar 2003 19:16:37 +0000 Subject: [PATCH] Added check for the screen saver actually being active before entering the loop waiting for it to deactivate. The failure to check was causing the screen saver code to kick in when the screen saver timeout occurred, even if the screen saver wasn't enabled (because Windows still sends the screen saver activating message for no good reason when the screen saver is disabled). --- lib/platform/CMSWindowsScreenSaver.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/platform/CMSWindowsScreenSaver.cpp b/lib/platform/CMSWindowsScreenSaver.cpp index e2d4ab3e..14e0bac3 100644 --- a/lib/platform/CMSWindowsScreenSaver.cpp +++ b/lib/platform/CMSWindowsScreenSaver.cpp @@ -100,6 +100,15 @@ CMSWindowsScreenSaver::checkStarted(UINT msg, WPARAM wParam, LPARAM lParam) // on the windows nt family we wait for the desktop to // change until it's neither the Screen-Saver desktop // nor a desktop we can't open (the login desktop). + // since windows will send the request-to-start-screen- + // saver message even when the screen saver is disabled + // we first check that the screen saver is indeed active + // before watching for it to stop. + if (!isActive()) { + LOG((CLOG_DEBUG "can't open screen saver desktop")); + return false; + } + watchDesktop(); }