summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-06-14 00:24:41 +0200
committerwm4 <wm4@nowhere>2013-06-14 00:37:39 +0200
commitf1d3ba0e3318eb4b0ac5686fed4b80acb3753919 (patch)
treeb433072a2e2fc7ff04d4e413bdea94bada3a335c /video
parent648c3d790a2e5123fdea0f02743058b59e85dd94 (diff)
downloadmpv-f1d3ba0e3318eb4b0ac5686fed4b80acb3753919.tar.bz2
mpv-f1d3ba0e3318eb4b0ac5686fed4b80acb3753919.tar.xz
x11: enable screensaver when paused, rename/change --stop-xscreensaver
Use the recently introduced screensaver VOCTRLs to control the screensaver in the X11 backend. This means the behavior when paused changes: the old code always kept the screensaver disabled, but now the screensaver is reenabled on pausing. Rename the --stop-xscreensaver option to --stop-screensaver and make it more generic. Now it affects all backends that respond to the screensaver VOCTRLs.
Diffstat (limited to 'video')
-rw-r--r--video/out/x11_common.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/video/out/x11_common.c b/video/out/x11_common.c
index 5eb6031d66..ecafc4a324 100644
--- a/video/out/x11_common.c
+++ b/video/out/x11_common.c
@@ -496,9 +496,6 @@ int vo_x11_init(struct vo *vo)
fstype_dump(x11->fs_type);
- if (opts->stop_screensaver)
- saver_off(x11);
-
vo->event_fd = ConnectionNumber(x11->display);
return 1;
@@ -1371,6 +1368,7 @@ static void vo_x11_border(struct vo *vo)
int vo_x11_control(struct vo *vo, int *events, int request, void *arg)
{
+ struct vo_x11_state *x11 = vo->x11;
switch (request) {
case VOCTRL_CHECK_EVENTS:
*events |= vo_x11_check_events(vo);
@@ -1392,6 +1390,12 @@ int vo_x11_control(struct vo *vo, int *events, int request, void *arg)
case VOCTRL_SET_CURSOR_VISIBILITY:
vo_set_cursor_hidden(vo, !(*(bool *)arg));
return VO_TRUE;
+ case VOCTRL_KILL_SCREENSAVER:
+ saver_off(x11);
+ return VO_TRUE;
+ case VOCTRL_RESTORE_SCREENSAVER:
+ saver_on(x11);
+ return VO_TRUE;
}
return VO_NOTIMPL;
}