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

@@ -1,6 +1,7 @@
#include "CXWindowsPrimaryScreen.h"
#include "CServer.h"
#include "CXWindowsClipboard.h"
#include "CXWindowsScreenSaver.h"
#include "CXWindowsUtil.h"
#include "CThread.h"
#include "CLog.h"
@@ -60,6 +61,14 @@ CXWindowsPrimaryScreen::run()
}
break;
case ClientMessage:
if (xevent.xclient.message_type == m_atomScreenSaver ||
xevent.xclient.format == 32) {
// screen saver activation/deactivation event
m_server->onScreenSaver(xevent.xclient.data.l[0] != 0);
}
break;
case KeyPress:
{
log((CLOG_DEBUG1 "event: KeyPress code=%d, state=0x%04x", xevent.xkey.keycode, xevent.xkey.state));
@@ -267,6 +276,10 @@ CXWindowsPrimaryScreen::open(CServer* server)
{
CDisplayLock display(this);
// get notified of screen saver activation/deactivation
m_atomScreenSaver = XInternAtom(display, "SCREENSAVER", False);
getScreenSaver()->setNotify(m_window);
// update key state
updateModifierMap(display);
@@ -298,6 +311,10 @@ CXWindowsPrimaryScreen::close()
{
assert(m_server != NULL);
// stop being notified of screen saver activation/deactivation
getScreenSaver()->setNotify(None);
m_atomScreenSaver = None;
// close the display
closeDisplay();