vlc/vlc-3.0 | branch: master | Hugo Beauzée-Luyssen <h...@beauzee.fr> | Tue Feb 
13 14:23:39 2018 +0100| [1b3f5f52a229e6357db6bb9785005caee745610f] | committer: 
Hugo Beauzée-Luyssen

win32: Inhibit: Fix inhibition on Windows XP

Fix #19691

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=1b3f5f52a229e6357db6bb9785005caee745610f
---

 modules/video_output/win32/inhibit.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/modules/video_output/win32/inhibit.c 
b/modules/video_output/win32/inhibit.c
index 7a4ce0053a..e77c842083 100644
--- a/modules/video_output/win32/inhibit.c
+++ b/modules/video_output/win32/inhibit.c
@@ -53,7 +53,7 @@ static void RestoreStateOnCancel( void* p_opaque )
 {
     VLC_UNUSED(p_opaque);
     SetThreadExecutionState( ES_CONTINUOUS );
-    msg_Err( (vlc_object_t*)p_opaque, "Restored context" );
+    SystemParametersInfo(SPI_SETSCREENSAVEACTIVE, 1, NULL, 0);
 }
 
 static void* Run(void* obj)
@@ -80,12 +80,18 @@ static void* Run(void* obj)
 
         bool suspend = (mask & VLC_INHIBIT_DISPLAY) != 0;
         if (suspend)
+        {
             /* Prevent monitor from powering off */
             prev_state = SetThreadExecutionState( ES_DISPLAY_REQUIRED |
                                                   ES_SYSTEM_REQUIRED |
                                                   ES_CONTINUOUS );
+            SystemParametersInfo(SPI_SETSCREENSAVEACTIVE, 0, NULL, 0);
+        }
         else
+        {
             SetThreadExecutionState( prev_state );
+            SystemParametersInfo(SPI_SETSCREENSAVEACTIVE, 1, NULL, 0);
+        }
     }
     vlc_assert_unreachable();
 }

_______________________________________________
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to