diff options
author | Philip Langdale <philipl@overt.org> | 2020-01-01 17:26:24 -0800 |
---|---|---|
committer | Philip Langdale <github.philipl@overt.org> | 2020-01-02 07:32:57 -0800 |
commit | daa125cb459f75378905673e2f8ee8d9341d19e6 (patch) | |
tree | f9982b26d5965dd18391615f661b9b8b08230dda /player/lua/osc.lua | |
parent | 5feee11e43a0907306db1df993cf1cd11c8596d9 (diff) | |
download | mpv-daa125cb459f75378905673e2f8ee8d9341d19e6.tar.bz2 mpv-daa125cb459f75378905673e2f8ee8d9341d19e6.tar.xz |
osc: reset input handling state on a change in visibility mode
Currently, the activation and deactivation of input handling is done
inside the render() loop, but this does not run when the osc mode is
`never` - which does make sense.
That means that if you are cycling the visibility mode, the input
state will be whatever it was at the time of the mode change. And,
as our modes are ordered `auto` -> `always` -> `never`, the input
state will be enabled when you cycle to `never`.
There are various ways you can imagine fixing this, and in this
change I propose we reset the input state to disabled on a mode
change, and then let render() re-enable input if that's appropriate.
Fixes #7298.
Diffstat (limited to 'player/lua/osc.lua')
-rw-r--r-- | player/lua/osc.lua | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/player/lua/osc.lua b/player/lua/osc.lua index 66b3c58d59..be139222c1 100644 --- a/player/lua/osc.lua +++ b/player/lua/osc.lua @@ -2671,6 +2671,13 @@ function visibility_mode(mode, no_osd) mp.osd_message("OSC visibility: " .. mode) end + -- Reset the input state on a mode change. The input state will be + -- recalcuated on the next render cycle, except in 'never' mode where it + -- will just stay disabled. + mp.disable_key_bindings("input") + mp.disable_key_bindings("window-controls") + state.input_enabled = false + update_margins() request_tick() end |