Commit d38e0f86 authored by Felix Abecassis's avatar Felix Abecassis Committed by Jean-Baptiste Kempf

Win32: correctly use option "disable-screensaver"

Close #10366.
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent 9b67dffa
...@@ -63,6 +63,7 @@ int CommonInit(vout_display_t *vd) ...@@ -63,6 +63,7 @@ int CommonInit(vout_display_t *vd)
sys->is_on_top = false; sys->is_on_top = false;
var_Create(vd, "video-deco", VLC_VAR_BOOL | VLC_VAR_DOINHERIT); var_Create(vd, "video-deco", VLC_VAR_BOOL | VLC_VAR_DOINHERIT);
var_Create(vd, "disable-screensaver", VLC_VAR_BOOL | VLC_VAR_DOINHERIT);
/* */ /* */
sys->event = EventThreadCreate(vd); sys->event = EventThreadCreate(vd);
...@@ -98,7 +99,6 @@ int CommonInit(vout_display_t *vd) ...@@ -98,7 +99,6 @@ int CommonInit(vout_display_t *vd)
vout_display_SendEventFullscreen(vd, false); vout_display_SendEventFullscreen(vd, false);
} }
var_Create(vd, "disable-screensaver", VLC_VAR_BOOL | VLC_VAR_DOINHERIT);
DisableScreensaver (vd); DisableScreensaver (vd);
return VLC_SUCCESS; return VLC_SUCCESS;
......
...@@ -157,7 +157,8 @@ static void *EventThread( void *p_this ) ...@@ -157,7 +157,8 @@ static void *EventThread( void *p_this )
} }
/* Prevent monitor from powering off */ /* Prevent monitor from powering off */
SetThreadExecutionState( ES_DISPLAY_REQUIRED | ES_SYSTEM_REQUIRED | ES_CONTINUOUS ); if (var_GetBool(vd, "disable-screensaver"))
SetThreadExecutionState( ES_DISPLAY_REQUIRED | ES_SYSTEM_REQUIRED | ES_CONTINUOUS );
/* Main loop */ /* Main loop */
/* GetMessage will sleep if there's no message in the queue */ /* GetMessage will sleep if there's no message in the queue */
...@@ -919,13 +920,6 @@ static long FAR PASCAL WinVoutEventProc( HWND hwnd, UINT message, ...@@ -919,13 +920,6 @@ static long FAR PASCAL WinVoutEventProc( HWND hwnd, UINT message,
} }
vout_display_t *vd = p_event->vd; vout_display_t *vd = p_event->vd;
/* Catch the screensaver and the monitor turn-off */
if( message == WM_SYSCOMMAND &&
( (wParam & 0xFFF0) == SC_SCREENSAVE || (wParam & 0xFFF0) == SC_MONITORPOWER ) )
{
//if( vd ) msg_Dbg( vd, "WinProc WM_SYSCOMMAND screensaver" );
return 0; /* this stops them from happening */
}
#if 0 #if 0
if( message == WM_SETCURSOR ) if( message == WM_SETCURSOR )
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment