diff --git a/src/dllmain.c b/src/dllmain.c index 39d7dbb..97d675f 100644 --- a/src/dllmain.c +++ b/src/dllmain.c @@ -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);