From f1d3ba0e3318eb4b0ac5686fed4b80acb3753919 Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 14 Jun 2013 00:24:41 +0200 Subject: 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. --- video/out/x11_common.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'video') 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; } -- cgit v1.2.3