mirror of
https://github.com/mpv-player/mpv
synced 2025-02-03 05:31:34 +00:00
w32: enable screensaver when paused
This is quite similar to the previous commit. Untested. I'm not sure if this is how it's supposed to work. At least --no-stop-screensaver should work in any case.
This commit is contained in:
parent
f1d3ba0e33
commit
118a2a359f
@ -174,10 +174,13 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam,
|
|||||||
break;
|
break;
|
||||||
case WM_SYSCOMMAND:
|
case WM_SYSCOMMAND:
|
||||||
switch (wParam) {
|
switch (wParam) {
|
||||||
case SC_SCREENSAVE:
|
case SC_SCREENSAVE:
|
||||||
case SC_MONITORPOWER:
|
case SC_MONITORPOWER:
|
||||||
|
if (w32->disable_screensaver) {
|
||||||
mp_msg(MSGT_VO, MSGL_V, "vo: win32: killing screensaver\n");
|
mp_msg(MSGT_VO, MSGL_V, "vo: win32: killing screensaver\n");
|
||||||
return 0;
|
return 0;
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case WM_KEYDOWN:
|
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)
|
int vo_w32_control(struct vo *vo, int *events, int request, void *arg)
|
||||||
{
|
{
|
||||||
|
struct vo_w32_state *w32 = vo->w32;
|
||||||
switch (request) {
|
switch (request) {
|
||||||
case VOCTRL_CHECK_EVENTS:
|
case VOCTRL_CHECK_EVENTS:
|
||||||
*events |= vo_w32_check_events(vo);
|
*events |= vo_w32_check_events(vo);
|
||||||
@ -696,6 +700,12 @@ int vo_w32_control(struct vo *vo, int *events, int request, void *arg)
|
|||||||
} else {
|
} else {
|
||||||
while (ShowCursor(0) >= 0) { }
|
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;
|
return VO_NOTIMPL;
|
||||||
}
|
}
|
||||||
|
@ -44,6 +44,7 @@ struct vo_w32_state {
|
|||||||
uint32_t o_dwidth;
|
uint32_t o_dwidth;
|
||||||
uint32_t o_dheight;
|
uint32_t o_dheight;
|
||||||
|
|
||||||
|
bool disable_screensaver;
|
||||||
int event_flags;
|
int event_flags;
|
||||||
int mon_cnt;
|
int mon_cnt;
|
||||||
int mon_id;
|
int mon_id;
|
||||||
|
Loading…
Reference in New Issue
Block a user