From 3671153a4f323d982953e26cdc1aca7329a167a0 Mon Sep 17 00:00:00 2001 From: Richard Stanway Date: Thu, 5 Nov 2015 03:58:26 +0100 Subject: [PATCH] libobs: Don't use SPI_SETSCREENSAVEACTIVE on Windows SetThreadExecutionState with ES_DISPLAY_REQUIRED has the same effect of preventing the screensaver from activating. Using SPI_SETSCREENSAVEACTIVE leaves the screensaver disabled system-wide if OBS crashes before it can re-enable it. --- libobs/util/platform-windows.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/libobs/util/platform-windows.c b/libobs/util/platform-windows.c index c53f4ea4d..952fcb528 100644 --- a/libobs/util/platform-windows.c +++ b/libobs/util/platform-windows.c @@ -734,7 +734,6 @@ void get_win_ver(struct win_version_info *info) } struct os_inhibit_info { - BOOL was_active; bool active; }; @@ -752,18 +751,12 @@ bool os_inhibit_sleep_set_active(os_inhibit_t *info, bool active) return false; if (active) { - SystemParametersInfo(SPI_GETSCREENSAVEACTIVE, 0, - &info->was_active, 0); - SystemParametersInfo(SPI_SETSCREENSAVEACTIVE, false, - NULL, 0); SetThreadExecutionState( ES_CONTINUOUS | ES_SYSTEM_REQUIRED | ES_AWAYMODE_REQUIRED | ES_DISPLAY_REQUIRED); } else { - SystemParametersInfo(SPI_SETSCREENSAVEACTIVE, info->was_active, - NULL, 0); SetThreadExecutionState(ES_CONTINUOUS); }