Skip to content

Commit

Permalink
osc: don't initialize while mouse-down over an element
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
avih committed Jun 20, 2021
1 parent 96b246d commit 89efe82
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion player/lua/osc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 89efe82

Please sign in to comment.