summaryrefslogtreecommitdiffstats
path: root/player/lua/osc.lua
diff options
context:
space:
mode:
Diffstat (limited to 'player/lua/osc.lua')
-rw-r--r--player/lua/osc.lua12
1 files changed, 11 insertions, 1 deletions
diff --git a/player/lua/osc.lua b/player/lua/osc.lua
index 9e1978bfc3..bea95e1323 100644
--- a/player/lua/osc.lua
+++ b/player/lua/osc.lua
@@ -101,6 +101,7 @@ local state = {
tc_ms = user_opts.timems, -- Should the timecodes display their time with milliseconds
mp_screen_sizeX, mp_screen_sizeY, -- last screen-resolution, to detect resolution changes to issue reINITs
initREQ = false, -- is a re-init request pending?
+ marginsREQ = false, -- is a margins update pending?
last_mouseX, last_mouseY, -- last mouse position, to detect significant mouse movement
mouse_in_window = false,
message_text,
@@ -2099,7 +2100,10 @@ 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
+ if (not state.osc_visible) or (get_hidetimeout() >= 0) or
+ (state.fullscreen and not user_opts.showfullscreen) or
+ (not state.fullscreen and not user_opts.showwindowed)
+ then
margins = {l = 0, r = 0, t = 0, b = 0}
end
@@ -2505,6 +2509,11 @@ local santa_hat_lines = {
-- called by mpv on every frame
function tick()
+ if state.marginsREQ == true then
+ update_margins()
+ state.marginsREQ = false
+ end
+
if (not state.enabled) then return end
if (state.idle) then
@@ -2608,6 +2617,7 @@ end)
mp.observe_property("fullscreen", "bool",
function(name, val)
state.fullscreen = val
+ state.marginsREQ = true
request_init_resize()
end
)