[vlc-commits] Win32: correctly use option "disable-screensaver"
Felix Abecassis
git at videolan.org
Sun Jan 26 15:00:08 CET 2014
vlc/vlc-2.1 | branch: master | Felix Abecassis <felix.abecassis at gmail.com> | Fri Jan 24 19:14:53 2014 +0100| [a365ac25fbe216c99321be24e63aab99f2f37602] | committer: Jean-Baptiste Kempf
Win32: correctly use option "disable-screensaver"
Close #10366.
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
(cherry picked from commit d38e0f861f5b7e38f52bb54b55062cfa93b28eb2)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
Conflicts:
modules/video_output/msw/common.c
> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.1.git/?a=commit;h=a365ac25fbe216c99321be24e63aab99f2f37602
---
modules/video_output/msw/common.c | 3 +--
modules/video_output/msw/events.c | 10 ++--------
2 files changed, 3 insertions(+), 10 deletions(-)
diff --git a/modules/video_output/msw/common.c b/modules/video_output/msw/common.c
index a0e663d..d20c136 100644
--- a/modules/video_output/msw/common.c
+++ b/modules/video_output/msw/common.c
@@ -78,6 +78,7 @@ int CommonInit(vout_display_t *vd)
sys->is_on_top = false;
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);
@@ -113,8 +114,6 @@ int CommonInit(vout_display_t *vd)
vout_display_SendEventFullscreen(vd, false);
}
- /* Why not with glwin32 */
- var_Create(vd, "disable-screensaver", VLC_VAR_BOOL | VLC_VAR_DOINHERIT);
DisableScreensaver (vd);
return VLC_SUCCESS;
diff --git a/modules/video_output/msw/events.c b/modules/video_output/msw/events.c
index ada4d43..df1697f 100644
--- a/modules/video_output/msw/events.c
+++ b/modules/video_output/msw/events.c
@@ -225,7 +225,8 @@ static void *EventThread( void *p_this )
}
/* 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 */
/* GetMessage will sleep if there's no message in the queue */
@@ -753,13 +754,6 @@ static long FAR PASCAL DirectXEventProc( HWND hwnd, UINT message,
}
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( message == WM_SETCURSOR )
{
More information about the vlc-commits
mailing list