diff options
author | Dudemanguy <random342@airmail.cc> | 2022-02-18 14:39:25 -0600 |
---|---|---|
committer | Dudemanguy <random342@airmail.cc> | 2022-02-18 22:04:08 +0000 |
commit | 27c38eac1040cd781f39d977ce53adcd65ddcfb6 (patch) | |
tree | c14b81de97c5b6c1581dac26d0aa55c268ff70b9 /player | |
parent | beac97ba0740982ec82bf1081821295ef6ba5b3e (diff) | |
download | mpv-27c38eac1040cd781f39d977ce53adcd65ddcfb6.tar.bz2 mpv-27c38eac1040cd781f39d977ce53adcd65ddcfb6.tar.xz |
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.
Diffstat (limited to 'player')
-rw-r--r-- | player/playloop.c | 3 |
1 files changed, 2 insertions, 1 deletions
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); } |