From 27c38eac1040cd781f39d977ce53adcd65ddcfb6 Mon Sep 17 00:00:00 2001 From: Dudemanguy Date: Fri, 18 Feb 2022 14:39:25 -0600 Subject: options: add always to stop-screensaver The stop-screensaver option is currently limited to a simple yes/no option. While the no option does always disable mpv trying to stop the screensaver, yes does not mean the screensaver is always stopped. The screensaver will be enabled again depending on certain conditions (like if the player is paused). Simply introduce a new value for this option, always, which does exactly what the name implies: the screensaver will always be disabled. --- player/playloop.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'player') diff --git a/player/playloop.c b/player/playloop.c index aea74d437c..093c135878 100644 --- a/player/playloop.c +++ b/player/playloop.c @@ -197,7 +197,8 @@ void update_screensaver_state(struct MPContext *mpctx) if (!mpctx->video_out) return; - bool saver_state = !mpctx->playback_active || !mpctx->opts->stop_screensaver; + bool saver_state = (!mpctx->playback_active || !mpctx->opts->stop_screensaver) && + mpctx->opts->stop_screensaver != 2; vo_control_async(mpctx->video_out, saver_state ? VOCTRL_RESTORE_SCREENSAVER : VOCTRL_KILL_SCREENSAVER, NULL); } -- cgit v1.2.3