osc: use video margins only if OSC is visible

Looks awkward otherwise. This means that even if boxvideo is enabled,
nothing gets "boxed" if the OSC is set to auto-hide.
This commit is contained in:
wm4 2019-12-22 12:50:29 +01:00
parent 6bf1a83057
commit b899504862
1 changed files with 5 additions and 6 deletions

View File

@ -2051,6 +2051,11 @@ end
function update_margins()
local margins = osc_param.video_margins
-- Don't use margins if it's visible only temporarily.
if (not state.osc_visible) or (get_hidetimeout() >= 0) then
margins = {l = 0, r = 0, t = 0, b = 0}
end
if user_opts.boxvideo then
-- check whether any margin option has a non-default value
local margins_used = false
@ -2076,12 +2081,6 @@ function update_margins()
reset_margins()
end
-- Don't report margins if it's visible only temporarily. At least for
-- console.lua this makes no sense.
if (not state.osc_visible) or (get_hidetimeout() >= 0) then
margins = {l = 0, r = 0, t = 0, b = 0}
end
utils.shared_script_property_set("osc-margins",
string.format("%f,%f,%f,%f", margins.l, margins.r, margins.t, margins.b))
end