summaryrefslogtreecommitdiffstats
path: root/video/out/w32_common.c
diff options
context:
space:
mode:
Diffstat (limited to 'video/out/w32_common.c')
-rw-r--r--video/out/w32_common.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/video/out/w32_common.c b/video/out/w32_common.c
index 42a158a42f..18f971050d 100644
--- a/video/out/w32_common.c
+++ b/video/out/w32_common.c
@@ -174,10 +174,13 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam,
break;
case WM_SYSCOMMAND:
switch (wParam) {
- case SC_SCREENSAVE:
- case SC_MONITORPOWER:
+ case SC_SCREENSAVE:
+ case SC_MONITORPOWER:
+ if (w32->disable_screensaver) {
mp_msg(MSGT_VO, MSGL_V, "vo: win32: killing screensaver\n");
return 0;
+ }
+ break;
}
break;
case WM_KEYDOWN:
@@ -672,6 +675,7 @@ static void vo_w32_ontop(struct vo *vo)
int vo_w32_control(struct vo *vo, int *events, int request, void *arg)
{
+ struct vo_w32_state *w32 = vo->w32;
switch (request) {
case VOCTRL_CHECK_EVENTS:
*events |= vo_w32_check_events(vo);
@@ -696,6 +700,12 @@ int vo_w32_control(struct vo *vo, int *events, int request, void *arg)
} else {
while (ShowCursor(0) >= 0) { }
}
+ case VOCTRL_KILL_SCREENSAVER:
+ w32->disable_screensaver = true;
+ break;
+ case VOCTRL_RESTORE_SCREENSAVER:
+ w32->disable_screensaver = false;
+ break;
}
return VO_NOTIMPL;
}