osc: move windowcontrols option code to the right place

There doesn't seem to be a reason why it was where it was. It should be
in validate_user_opts(), which will be important for runtime changing
too.
This commit is contained in:
wm4 2019-12-20 13:21:49 +01:00
parent 7338e3d8fe
commit 70c5401952
1 changed files with 14 additions and 15 deletions

View File

@ -59,21 +59,6 @@ if user_opts.hidetimeout < 0 then
msg.warn("hidetimeout cannot be negative. Using " .. user_opts.hidetimeout)
end
-- validate window control options
if user_opts.windowcontrols ~= "auto" and
user_opts.windowcontrols ~= "yes" and
user_opts.windowcontrols ~= "no" then
msg.warn("windowcontrols cannot be \"" ..
user_opts.windowcontrols .. "\". Ignoring.")
user_opts.windowcontrols = "auto"
end
if user_opts.windowcontrols_alignment ~= "right" and
user_opts.windowcontrols_alignment ~= "left" then
msg.warn("windowcontrols_alignment cannot be \"" ..
user_opts.windowcontrols_alignment .. "\". Ignoring.")
user_opts.windowcontrols_alignment = "right"
end
local osc_param = { -- calculated by osc_init()
playresy = 0, -- canvas size Y
playresx = 0, -- canvas size X
@ -1645,6 +1630,20 @@ function validate_user_opts()
msg.warn("Using \"slider\" seekrangestyle together with \"bar\" seekbarstyle is not supported")
user_opts.seekrangestyle = "inverted"
end
if user_opts.windowcontrols ~= "auto" and
user_opts.windowcontrols ~= "yes" and
user_opts.windowcontrols ~= "no" then
msg.warn("windowcontrols cannot be \"" ..
user_opts.windowcontrols .. "\". Ignoring.")
user_opts.windowcontrols = "auto"
end
if user_opts.windowcontrols_alignment ~= "right" and
user_opts.windowcontrols_alignment ~= "left" then
msg.warn("windowcontrols_alignment cannot be \"" ..
user_opts.windowcontrols_alignment .. "\". Ignoring.")
user_opts.windowcontrols_alignment = "right"
end
end