SYNERGY-856 - Add option to prevent client from sleeping (#7001)

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

* Update changelog

* Added option to the GUI

* Only set system to be in use

* Remove leftover code affecting display and system power off

* Add option parsing to the correct place

* Update changelog

* Remove prevent sleep option from struct initializer, replace NULL with nullptr in relevant places

* Remove duplicated code

* Prevent sleep on Mac clients

* SYNERGY-856 - Return language sync option
This commit is contained in:
Igor Sikachyna
2021-05-31 01:53:49 -07:00
committed by GitHub
parent 58b74f4ff0
commit 9302f86bb0
11 changed files with 99 additions and 48 deletions

View File

@ -247,6 +247,10 @@ MSWindowsScreen::enable()
// watch jump zones
m_hook.setMode(kHOOK_WATCH_JUMP_ZONE);
}
if (App::instance().argsBase().m_preventSleep) {
ArchMiscWindows::addBusyState(ArchMiscWindows::kSYSTEM);
}
}
void
@ -262,6 +266,10 @@ MSWindowsScreen::disable()
// enable special key sequences on win95 family
enableSpecialKeys(true);
}
else {
// allow the system to enter power saving mode
ArchMiscWindows::removeBusyState(ArchMiscWindows::kSYSTEM);
}
// tell key state
m_keyState->disable();