summaryrefslogtreecommitdiffstats
path: root/options
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-10-02 12:33:34 +0200
committerwm4 <wm4@nowhere>2016-10-02 12:33:34 +0200
commit39fc5e1deb0c5753e7123529e4dd5c750aed1e8d (patch)
tree92b460dc2802ccf34c3ea413370daa98428f7a1e /options
parente3a57272a712542e739b97db31efebc4cc17c53a (diff)
downloadmpv-39fc5e1deb0c5753e7123529e4dd5c750aed1e8d.tar.bz2
mpv-39fc5e1deb0c5753e7123529e4dd5c750aed1e8d.tar.xz
player: make --stop-screensaver runtime-changeable
Move the screensaver enable/disable determination to a central place, and call it if the stop-screensaver property is changed. Also, do not stop the screensaver when in idle mode (i.e. no file is loaded). Fixes #3615.
Diffstat (limited to 'options')
-rw-r--r--options/m_option.h3
-rw-r--r--options/options.c2
2 files changed, 3 insertions, 2 deletions
diff --git a/options/m_option.h b/options/m_option.h
index 69113bbd8c..d784d8f54d 100644
--- a/options/m_option.h
+++ b/options/m_option.h
@@ -390,7 +390,8 @@ struct m_option {
#define UPDATE_INPUT (1 << 13) // mostly --input-* options
#define UPDATE_AUDIO (1 << 14) // --audio-channels etc.
#define UPDATE_PRIORITY (1 << 15) // --priority (Windows-only)
-#define UPDATE_OPT_LAST (1 << 15)
+#define UPDATE_SCREENSAVER (1 << 16) // --stop-screensaver
+#define UPDATE_OPT_LAST (1 << 16)
// All bits between _FIRST and _LAST (inclusive)
#define UPDATE_OPTS_MASK \
diff --git a/options/options.c b/options/options.c
index f8f5f707a5..d1e46ef4c6 100644
--- a/options/options.c
+++ b/options/options.c
@@ -540,7 +540,7 @@ const m_option_t mp_opts[] = {
OPT_CHOICE_OR_INT("cursor-autohide", cursor_autohide_delay, 0,
0, 30000, ({"no", -1}, {"always", -2})),
OPT_FLAG("cursor-autohide-fs-only", cursor_autohide_fs, 0),
- OPT_FLAG("stop-screensaver", stop_screensaver, 0),
+ OPT_FLAG("stop-screensaver", stop_screensaver, UPDATE_SCREENSAVER),
OPT_STRING("heartbeat-cmd", heartbeat_cmd, 0,
.deprecation_message = "use Lua scripting instead"),