summary refs log tree commit diff
path: root/.config/mvi/scripts/freeze-window.lua
blob: 693c71738cf0a4a5423ff10f8327b7580c0d6e1e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
-- credit to TheAMM

local size_changed = false

mp.register_idle(function()
    if not size_changed then return end
    local ww, wh = mp.get_osd_size()
    if not ww or ww <= 0 or not wh or wh <= 0 then return end
    mp.set_property("geometry", string.format("%dx%d", ww, wh))
    size_changed = false
end)

mp.observe_property("osd-width", "native", function() size_changed = true end)
mp.observe_property("osd-height", "native", function() size_changed = true end)