Improved handling of screen saver handling when windows 2k is
the client and the screen saver is password protected. It used to immediately turn off the screen saver (unintentionally) in that case.
This commit is contained in:
parent
41dc621579
commit
fd5625ba99
|
@ -473,9 +473,16 @@ CMSWindowsScreen::onPreDispatch(const CEvent* event)
|
||||||
if (isCurrentDesktop(desk)) {
|
if (isCurrentDesktop(desk)) {
|
||||||
CloseDesktop(desk);
|
CloseDesktop(desk);
|
||||||
}
|
}
|
||||||
else {
|
else if (!m_screensaver->isActive()) {
|
||||||
|
// don't switch desktops when the screensaver is
|
||||||
|
// active. we'd most likely switch to the
|
||||||
|
// screensaver desktop which would have the side
|
||||||
|
// effect of forcing the screensaver to stop.
|
||||||
switchDesktop(desk);
|
switchDesktop(desk);
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
CloseDesktop(desk);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -132,7 +132,7 @@ CMSWindowsScreenSaver::deactivate()
|
||||||
bool killed = false;
|
bool killed = false;
|
||||||
if (!m_is95Family) {
|
if (!m_is95Family) {
|
||||||
// NT runs screen saver in another desktop
|
// NT runs screen saver in another desktop
|
||||||
HDESK desktop = OpenDesktop("screen-saver", 0, FALSE,
|
HDESK desktop = OpenDesktop("Screen-saver", 0, FALSE,
|
||||||
DESKTOP_READOBJECTS | DESKTOP_WRITEOBJECTS);
|
DESKTOP_READOBJECTS | DESKTOP_WRITEOBJECTS);
|
||||||
if (desktop != NULL) {
|
if (desktop != NULL) {
|
||||||
EnumDesktopWindows(desktop,
|
EnumDesktopWindows(desktop,
|
||||||
|
@ -146,6 +146,10 @@ CMSWindowsScreenSaver::deactivate()
|
||||||
if (!killed) {
|
if (!killed) {
|
||||||
// find screen saver window and close it
|
// find screen saver window and close it
|
||||||
HWND hwnd = FindWindow("WindowsScreenSaverClass", NULL);
|
HWND hwnd = FindWindow("WindowsScreenSaverClass", NULL);
|
||||||
|
if (hwnd == NULL) {
|
||||||
|
// win2k may use a different class
|
||||||
|
hwnd = FindWindow("Default Screen Saver", NULL);
|
||||||
|
}
|
||||||
if (hwnd != NULL) {
|
if (hwnd != NULL) {
|
||||||
PostMessage(hwnd, WM_CLOSE, 0, 0);
|
PostMessage(hwnd, WM_CLOSE, 0, 0);
|
||||||
}
|
}
|
||||||
|
@ -167,7 +171,7 @@ CMSWindowsScreenSaver::isActive() const
|
||||||
}
|
}
|
||||||
else if (m_isNT) {
|
else if (m_isNT) {
|
||||||
// screen saver runs on a separate desktop
|
// screen saver runs on a separate desktop
|
||||||
HDESK desktop = OpenDesktop("screen-saver", 0, FALSE, MAXIMUM_ALLOWED);
|
HDESK desktop = OpenDesktop("Screen-saver", 0, FALSE, MAXIMUM_ALLOWED);
|
||||||
if (desktop == NULL && GetLastError() != ERROR_ACCESS_DENIED) {
|
if (desktop == NULL && GetLastError() != ERROR_ACCESS_DENIED) {
|
||||||
// desktop doesn't exist so screen saver is not running
|
// desktop doesn't exist so screen saver is not running
|
||||||
return false;
|
return false;
|
||||||
|
@ -241,7 +245,7 @@ CMSWindowsScreenSaver::findScreenSaver()
|
||||||
{
|
{
|
||||||
if (!m_is95Family) {
|
if (!m_is95Family) {
|
||||||
// screen saver runs on a separate desktop
|
// screen saver runs on a separate desktop
|
||||||
HDESK desktop = OpenDesktop("screen-saver", 0, FALSE, MAXIMUM_ALLOWED);
|
HDESK desktop = OpenDesktop("Screen-saver", 0, FALSE, MAXIMUM_ALLOWED);
|
||||||
if (desktop != NULL) {
|
if (desktop != NULL) {
|
||||||
// search
|
// search
|
||||||
CFindScreenSaverInfo info;
|
CFindScreenSaverInfo info;
|
||||||
|
|
Loading…
Reference in New Issue