SYNERGY-1088 Windows client ignores prevent sleeping option
This commit is contained in:
@ -164,6 +164,10 @@ MSWindowsScreen::MSWindowsScreen(
|
||||
LOG((CLOG_ERR "failed to get desktop path, no drop target available, error=%d", GetLastError()));
|
||||
}
|
||||
|
||||
if (App::instance().argsBase().m_preventSleep) {
|
||||
m_powerManager.disableSleep();
|
||||
}
|
||||
|
||||
OleInitialize(0);
|
||||
m_dropWindow = createDropWindow(m_class, "DropWindow");
|
||||
m_dropTarget = new MSWindowsDropTarget();
|
||||
@ -248,11 +252,6 @@ MSWindowsScreen::enable()
|
||||
// watch jump zones
|
||||
m_hook.setMode(kHOOK_WATCH_JUMP_ZONE);
|
||||
}
|
||||
|
||||
if (App::instance().argsBase().m_preventSleep) {
|
||||
ArchMiscWindows::addBusyState(ArchMiscWindows::kSYSTEM);
|
||||
ArchMiscWindows::addBusyState(ArchMiscWindows::kDISPLAY);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
@ -268,11 +267,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::removeBusyState(ArchMiscWindows::kDISPLAY);
|
||||
}
|
||||
|
||||
// tell key state
|
||||
m_keyState->disable();
|
||||
@ -2086,4 +2080,4 @@ MSWindowsScreen::updateScrollDirection()
|
||||
});
|
||||
scrollDirectionUpdateThread.detach();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user