SYNERGY-538 - Allow Windows to go to sleep depending on system preferences (#6997)

* Disable thread execution state changes preventing the system from going to sleep

* Update changelog

* Remove leftover code affecting display and system power off

Co-authored-by: SerhiiGadzhilov <71632867+SerhiiGadzhilov@users.noreply.github.com>
This commit is contained in:
Igor Sikachyna 2021-05-28 01:58:11 -07:00 committed by GitHub
parent 069ff35ac8
commit 98bdcd4a46
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 1 additions and 29 deletions

View file

@ -4,6 +4,7 @@ Bug fixes:
- #7016 Fix script that generates version number
- #7006 Resolve code scanning issues
- #7012 Fix natural horizontal scrolling on Mac client
- #6997 Allow Windows to go to sleep depending on system preferences
Enhancements:
- #6998 Remove functionality related to the screen saver synchronisation

View file

@ -247,12 +247,6 @@ MSWindowsScreen::enable()
// watch jump zones
m_hook.setMode(kHOOK_WATCH_JUMP_ZONE);
}
else {
// prevent the system from entering power saving modes. if
// it did we'd be forced to disconnect from the server and
// the server would not be able to wake us up.
ArchMiscWindows::addBusyState(ArchMiscWindows::kSYSTEM);
}
}
void
@ -268,11 +262,6 @@ MSWindowsScreen::disable()
// enable special key sequences on win95 family
enableSpecialKeys(true);
}
else {
// allow the system to enter power saving mode
ArchMiscWindows::removeBusyState(ArchMiscWindows::kSYSTEM |
ArchMiscWindows::kDISPLAY);
}
// tell key state
m_keyState->disable();
@ -1503,18 +1492,12 @@ MSWindowsScreen::onScreensaver(bool activated)
m_screensaver->checkStarted(SYNERGY_MSG_SCREEN_SAVER, FALSE, 0)) {
m_screensaverActive = true;
sendEvent(m_events->forIPrimaryScreen().screensaverActivated());
// enable display power down
ArchMiscWindows::removeBusyState(ArchMiscWindows::kDISPLAY);
}
}
else {
if (m_screensaverActive) {
m_screensaverActive = false;
sendEvent(m_events->forIPrimaryScreen().screensaverDeactivated());
// disable display power down
ArchMiscWindows::addBusyState(ArchMiscWindows::kDISPLAY);
}
}

View file

@ -113,9 +113,6 @@ MSWindowsScreenSaver::enable()
if (m_wasSecure) {
setSecure(true, m_wasSecureAnInt);
}
// restore display power down
ArchMiscWindows::removeBusyState(ArchMiscWindows::kDISPLAY);
}
void
@ -129,9 +126,6 @@ MSWindowsScreenSaver::disable()
if (m_wasSecure) {
setSecure(false, m_wasSecureAnInt);
}
// disable display power down
ArchMiscWindows::addBusyState(ArchMiscWindows::kDISPLAY);
}
void
@ -148,9 +142,6 @@ MSWindowsScreenSaver::activate()
// no foreground window. pretend we got the event instead.
DefWindowProc(NULL, WM_SYSCOMMAND, SC_SCREENSAVE, 0);
}
// restore power save when screen saver activates
ArchMiscWindows::removeBusyState(ArchMiscWindows::kDISPLAY);
}
}
@ -188,9 +179,6 @@ MSWindowsScreenSaver::deactivate()
!m_wasEnabled, 0, SPIF_SENDWININICHANGE);
SystemParametersInfo(SPI_SETSCREENSAVEACTIVE,
m_wasEnabled, 0, SPIF_SENDWININICHANGE);
// disable display power down
ArchMiscWindows::removeBusyState(ArchMiscWindows::kDISPLAY);
}
bool