checkpoint. adding screen saver support. only on X so far

and untested.  also some known problems:  not detecting an
xscreensaver started after us and not detecting built-in
screen saver activation (not sure if we can without using
ugly extensions).
This commit is contained in:
crs
2002-06-22 19:20:21 +00:00
parent 4e37691a9c
commit 504bfa2def
16 changed files with 532 additions and 30 deletions

View File

@@ -551,7 +551,7 @@ CClient::onScreenSaver()
CProtocolUtil::readf(m_input, kMsgCScreenSaver + 4, &on);
}
log((CLOG_DEBUG1 "recv screen saver on=%d", on));
// FIXME
m_screen->screenSaver(on != 0);
}
void

View File

@@ -1,6 +1,7 @@
#include "CXWindowsSecondaryScreen.h"
#include "CClient.h"
#include "CXWindowsClipboard.h"
#include "CXWindowsScreenSaver.h"
#include "CXWindowsUtil.h"
#include "CThread.h"
#include "CLog.h"
@@ -119,6 +120,9 @@ CXWindowsSecondaryScreen::open(CClient* client)
for (ClipboardID id = 0; id < kClipboardEnd; ++id) {
grabClipboard(id);
}
// disable the screen saver
getScreenSaver()->disable();
}
void
@@ -126,6 +130,9 @@ CXWindowsSecondaryScreen::close()
{
assert(m_client != NULL);
// restore the screen saver settings
getScreenSaver()->enable();
// close the display
closeDisplay();
@@ -287,6 +294,18 @@ CXWindowsSecondaryScreen::grabClipboard(ClipboardID id)
setDisplayClipboard(id, NULL);
}
void
CXWindowsSecondaryScreen::screenSaver(bool activate)
{
CDisplayLock display(this);
if (activate) {
getScreenSaver()->activate();
}
else {
getScreenSaver()->deactivate();
}
}
void
CXWindowsSecondaryScreen::getMousePos(SInt32& x, SInt32& y) const
{

View File

@@ -29,6 +29,7 @@ public:
virtual void mouseWheel(SInt32 delta);
virtual void setClipboard(ClipboardID, const IClipboard*);
virtual void grabClipboard(ClipboardID);
virtual void screenSaver(bool activate);
virtual void getMousePos(SInt32& x, SInt32& y) const;
virtual void getShape(SInt32&, SInt32&, SInt32&, SInt32&) const;
virtual SInt32 getJumpZoneSize() const;