From 70c540195245948978077ecb8316e2dca6807042 Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 20 Dec 2019 13:21:49 +0100 Subject: 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. --- player/lua/osc.lua | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/player/lua/osc.lua b/player/lua/osc.lua index 262e679891..e06e1ef8ef 100644 --- a/player/lua/osc.lua +++ b/player/lua/osc.lua @@ -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 -- cgit v1.2.3