osc.lua: use window title for window controls from mpv core

This commit is contained in:
Kacper Michajłow
2026-03-31 20:45:54 +02:00
parent 40db14f85b
commit 39302caae4
2 changed files with 2 additions and 3 deletions
@@ -0,0 +1 @@
remove `windowcontrols_title` script-opt from osc, use `title` mpv option instead
+1 -3
View File
@@ -53,7 +53,6 @@ local user_opts = {
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
windowcontrols_independent = true, -- show window controls and bottom bar independently
floatingtitle = true, -- show title in the floating layout?
floatingwidth = 700, -- width of the floating layout
@@ -315,7 +314,6 @@ local state = {
input_enabled = true,
showhide_enabled = false,
windowcontrols_buttons = false,
windowcontrols_title = false,
dmx_cache = 0,
using_video_margins = false,
border = true,
@@ -1402,7 +1400,7 @@ local function window_controls(topbar)
ne = new_element("wctitle", "button")
ne.is_wc = true
ne.content = function ()
local title = mp.command_native({"expand-text", user_opts.windowcontrols_title})
local title = mp.command_native({"expand-text", mp.get_property("title")})
title = title:gsub("\n", " ")
return title ~= "" and mp.command_native({"escape-ass", title}) or "mpv"
end