summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAvi Halachmi (:avih) <avihpit@yahoo.com>2021-06-20 17:16:34 +0300
committerAvi Halachmi (:avih) <avihpit@yahoo.com>2021-06-20 17:37:47 +0300
commit89efe820a8f1938246f6a619e027fb3067d661e9 (patch)
treed40d3c67f578527fd68f474cb23fa21d51d2c813
parent96b246d9283da99b82800bbd576037d115e3c6e9 (diff)
downloadmpv-89efe820a8f1938246f6a619e027fb3067d661e9.tar.bz2
mpv-89efe820a8f1938246f6a619e027fb3067d661e9.tar.xz
osc: don't initialize while mouse-down over an element
This is not a new issue, however, until the last commit - 96b246d init probably didn't happen much (or at all) between mouse-down and mouse-up, but after this commit, if there are chapters in a live-stream then osc_init() is used to re-render the markers at the adjusted position - which breaks the OSC buttons functionality if init happened between mouse-down and mouse-up.
-rw-r--r--player/lua/osc.lua9
1 files changed, 8 insertions, 1 deletions
diff --git a/player/lua/osc.lua b/player/lua/osc.lua
index f2b6d3ed2d..3c9337da8e 100644
--- a/player/lua/osc.lua
+++ b/player/lua/osc.lua
@@ -2263,7 +2263,14 @@ function render()
end
-- init management
- if state.initREQ then
+ if state.active_element then
+ -- mouse is held down on some element - keep ticking and igore initReq
+ -- till it's released, or else the mouse-up (click) will misbehave or
+ -- get ignored. that's because osc_init() recreates the osc elements,
+ -- but mouse handling depends on the elements staying unmodified
+ -- between mouse-down and mouse-up (using the index active_element).
+ request_tick()
+ elseif state.initREQ then
osc_init()
state.initREQ = false