diff --git a/DOCS/interface-changes/osc-margins.txt b/DOCS/interface-changes/osc-margins.txt index 64f7a36038..f4e61422cc 100644 --- a/DOCS/interface-changes/osc-margins.txt +++ b/DOCS/interface-changes/osc-margins.txt @@ -1,2 +1,3 @@ add `osc-dynamic_margins` option add `osc-sub-margin` option +add `osc-osd-margin` option diff --git a/DOCS/man/osc.rst b/DOCS/man/osc.rst index bd32443f7c..5981416761 100644 --- a/DOCS/man/osc.rst +++ b/DOCS/man/osc.rst @@ -420,6 +420,15 @@ Configurable Options already confined to the video area and this option has no additional effect. +``osd_margins`` + Default: yes + + Whether to adjust ``--osd-margin-y`` so that OSD text does not overlap + with the OSC. The offset is derived from the top OSC margin (including + window controls when present) and added on top of the current + ``--osd-margin-y`` value. Requires ``dynamic_margins`` or + ``visibility=always`` to take effect. + ``windowcontrols`` Default: auto (Show window controls if there is no window border) diff --git a/player/lua/osc.lua b/player/lua/osc.lua index ace10c384f..36db44e790 100644 --- a/player/lua/osc.lua +++ b/player/lua/osc.lua @@ -50,6 +50,7 @@ local user_opts = { boxvideo = false, -- apply osc_param.video_margins to video dynamic_margins = false, -- update margins dynamically with OSC visibility sub_margins = true, -- adjust sub-margin-y to not overlap with OSC + osd_margins = true, -- adjust osd-margin-y to not overlap with OSC windowcontrols = "auto", -- whether to show window controls windowcontrols_alignment = "right", -- which side to show window controls on windowcontrols_title = "${media-title}", -- same as title but for windowcontrols @@ -562,6 +563,7 @@ local function reset_margins() state.using_video_margins = false end set_margin_offset("sub-margin-y", 0) + set_margin_offset("osd-margin-y", 0) end local function update_margins() @@ -616,6 +618,7 @@ local function update_margins() return margin * osc_param.playresy end set_margin_offset("sub-margin-y", get_margin("sub")) + set_margin_offset("osd-margin-y", get_margin("osd")) mp.set_property_native("user-data/osc/margins", margins) end