SetThreadExecutionState for windows and SPI_SETSCREENSAVEACTIVE for WINE
This commit is contained in:
parent
7505295e33
commit
895db5bf93
1 changed files with 6 additions and 0 deletions
|
@ -132,6 +132,10 @@ BOOL WINAPI DllMain(HANDLE hDll, DWORD dwReason, LPVOID lpReserved)
|
|||
set_aware();
|
||||
}
|
||||
|
||||
/* Make sure screensaver will stay off and monitors will stay on */
|
||||
SetThreadExecutionState(ES_CONTINUOUS | ES_DISPLAY_REQUIRED);
|
||||
|
||||
/* WINE does not support SetThreadExecutionState so we'll have to use SPI_SETSCREENSAVEACTIVE instead */
|
||||
BOOL screensaver_enabled = FALSE;
|
||||
SystemParametersInfoA(SPI_GETSCREENSAVEACTIVE, 0, &screensaver_enabled, 0);
|
||||
|
||||
|
@ -161,6 +165,8 @@ BOOL WINAPI DllMain(HANDLE hDll, DWORD dwReason, LPVOID lpReserved)
|
|||
dinput_hook_exit();
|
||||
hook_exit();
|
||||
|
||||
SetThreadExecutionState(ES_CONTINUOUS);
|
||||
|
||||
if (g_screensaver_disabled)
|
||||
{
|
||||
SystemParametersInfoA(SPI_SETSCREENSAVEACTIVE, TRUE, NULL, 0);
|
||||
|
|
Loading…
Reference in a new issue