fixed handling of jumping to primary when screen saver starts

and back to secondary when it stops.  also now redirecting
keyboard input to root window when screen saver starts;  this
allows the user to type in the lock dialog and also effectively
discards any input used to deactivate the screen saver.
This commit is contained in:
crs
2002-06-23 23:24:22 +00:00
parent 80d11df2f9
commit 1377882a9f
7 changed files with 37 additions and 25 deletions

View File

@@ -323,20 +323,27 @@ CXWindowsPrimaryScreen::close()
}
void
CXWindowsPrimaryScreen::enter(SInt32 x, SInt32 y)
CXWindowsPrimaryScreen::enter(SInt32 x, SInt32 y, bool forScreenSaver)
{
log((CLOG_INFO "entering primary at %d,%d", x, y));
log((CLOG_INFO "entering primary at %d,%d%s", x, y, forScreenSaver ? " for screen saver" : ""));
assert(m_active == true);
assert(m_window != None);
CDisplayLock display(this);
// warp to requested location
XWarpPointer(display, None, m_window, 0, 0, 0, 0, x, y);
if (!forScreenSaver) {
XWarpPointer(display, None, m_window, 0, 0, 0, 0, x, y);
}
// unmap the grab window. this also ungrabs the mouse and keyboard.
XUnmapWindow(display, m_window);
// redirect input to root window
if (forScreenSaver) {
XSetInputFocus(display, PointerRoot, PointerRoot, CurrentTime);
}
// remove all input events for grab window
XEvent event;
while (XCheckWindowEvent(display, m_window,