OSC deadzonesize option behaves incorrectly
mpv version and platform
Windows 10 November 2019 Update (Build 18363)
mpv 0.30.0-256-g61b8e1d436 Copyright © 2000-2019 mpv/MPlayer/mplayer2 projects built on Sun Dec 1 14:52:22 UTC 2019 ffmpeg library versions: libavutil 56.36.101 libavcodec 58.64.101 libavformat 58.35.100 libswscale 5.6.100 libavfilter 7.67.100 libswresample 3.6.100 ffmpeg version: N-95918-ge5db2e96c0
Reproduction steps
--no-config --script-opts=osc-deadzonesize=1
Expected behavior
OSC should appear only when hovering on it.
Actual behavior
OSC appears on any mouse movement inside the player window.
It seems to always behave as deadzonesize=0
Log file
https://0x0.st/zlN-.log
this one killed it for me https://github.com/mpv-player/mpv/commit/2b4c8675057cd43c21d4c124381bfb9c9930871c the commit prior to this one works
This naive patch works, but I don't know really know if that's the proper way to fix this. I'll leave it up to @philipl since he added all the window control stuff.
diff --git a/player/lua/osc.lua b/player/lua/osc.lua
index a7cc62a91e..2c4a9d9558 100644
--- a/player/lua/osc.lua
+++ b/player/lua/osc.lua
@@ -2488,10 +2488,12 @@ mp.set_key_bindings({
{"mouse_move", function(e) process_event("mouse_move", nil) end},
{"mouse_leave", mouse_leave},
}, "showhide", "force")
-mp.set_key_bindings({
- {"mouse_move", function(e) process_event("mouse_move", nil) end},
- {"mouse_leave", mouse_leave},
-}, "showhide_wc", "force")
+if user_opts.windowcontrols ~= "no" then
+ mp.set_key_bindings({
+ {"mouse_move", function(e) process_event("mouse_move", nil) end},
+ {"mouse_leave", mouse_leave},
+ }, "showhide_wc", "force")
+end
do_enable_keybindings()
--mouse input bindings
confirmed patch is working, and takes care of another "side effect" of that commit which was the mouse cursor not auto-hiding when on top of the video
It doesn't seem right to me that merely using showhide_wc would mess with the deadzone values if windowcontrols are disabled in the first place, but then again why even execute mp.set_key_bindings if you aren't using window controls. I'm not too familiar with the osc stuff though.