osc: expose osc-visibility via shared-script-properties

osc-visibility can already be changed at runtime via script-message
or other means, but until now there was no way to tell what the
current state is.

Now shared-script-properties/osc-visibility reflects this state.
It's output-only by the osc - changing it does not affect the osc.

Useful if a script wants to change osc-visibility temporarily, and
later restore to its original state.

There's no way to coordinate if more than one script wants to change
it, but that would be a hard problem to solve anyway, even if the
osc itself tried to coordinate such requests from different sources.
This commit is contained in:
Avi Halachmi (:avih) 2021-07-05 11:01:22 +03:00 committed by avih
parent f2afae55e9
commit d2dd4cacb8
1 changed files with 1 additions and 0 deletions

View File

@ -2803,6 +2803,7 @@ function visibility_mode(mode, no_osd)
end
user_opts.visibility = mode
utils.shared_script_property_set("osc-visibility", mode)
if not no_osd and tonumber(mp.get_property("osd-level")) >= 1 then
mp.osd_message("OSC visibility: " .. mode)