mirror of
https://github.com/debauchee/barrier.git
synced 2026-05-12 03:16:07 +08:00
Fixed Issue #14: Synergy client on windows will not bring up desktop after screen powersave
This commit is contained in:
@@ -414,3 +414,26 @@ CArchMiscWindows::dummySetThreadExecutionState(DWORD)
|
||||
// do nothing
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
CArchMiscWindows::wakeupDisplay()
|
||||
{
|
||||
// We can't use ::setThreadExecutionState here because it sets
|
||||
// ES_CONTINUOUS, which we don't want.
|
||||
|
||||
if (s_stes == NULL) {
|
||||
HINSTANCE kernel = LoadLibrary("kernel32.dll");
|
||||
if (kernel != NULL) {
|
||||
s_stes = reinterpret_cast<STES_t>(GetProcAddress(kernel,
|
||||
"SetThreadExecutionState"));
|
||||
}
|
||||
if (s_stes == NULL) {
|
||||
s_stes = &CArchMiscWindows::dummySetThreadExecutionState;
|
||||
}
|
||||
}
|
||||
|
||||
s_stes(ES_DISPLAY_REQUIRED);
|
||||
|
||||
// restore the original execution states
|
||||
setThreadExecutionState(s_busyState);
|
||||
}
|
||||
@@ -161,6 +161,9 @@ public:
|
||||
//! Enable power saving
|
||||
static void removeBusyState(DWORD busyModes);
|
||||
|
||||
//! Briefly interrupt power saving
|
||||
static void wakeupDisplay();
|
||||
|
||||
private:
|
||||
//! Open and return a registry key, closing the parent key
|
||||
static HKEY openKey(HKEY parent, const TCHAR* child, bool create);
|
||||
|
||||
Reference in New Issue
Block a user