summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChrisK2 <spam@kalania.de>2013-10-14 19:47:19 +0200
committerChrisK2 <spam@kalania.de>2013-10-14 19:51:16 +0200
commit683da7411e6872de117cb36a6f175e8934b29d9e (patch)
tree23ae166cb32b320b5671f5208e8857fce9488331
parent94e71b7cc0671782ff6f886425d87dd44cd695b4 (diff)
downloadmpv-683da7411e6872de117cb36a6f175e8934b29d9e.tar.bz2
mpv-683da7411e6872de117cb36a6f175e8934b29d9e.tar.xz
osc: raise minmousemove default setting to 3 and disable input mouse area when OSC not visible
The mouse area that covers the OSC is now only activated when the OSC is actually visible, to make sure the mouse still hides if it happens to be parked in the OSC area without making the OSC show up.
-rw-r--r--mpvcore/lua/osc.lua17
1 files changed, 11 insertions, 6 deletions
diff --git a/mpvcore/lua/osc.lua b/mpvcore/lua/osc.lua
index 3bbfff88c4..648fdc142f 100644
--- a/mpvcore/lua/osc.lua
+++ b/mpvcore/lua/osc.lua
@@ -20,8 +20,8 @@ local user_opts = {
halign = 0, -- horizontal alignment, -1 (left) to 1 (right)
hidetimeout = 500, -- duration in ms until the OSC hides if no mouse movement
fadeduration = 200, -- duration of fade out in ms, 0 = no fade
- deadzonesize = 0, -- distance between OSC and deadzone
- minmousemove = 1, -- minimum amount of pixeles the mouse has to move between ticks to make the OSC show up
+ deadzonesize = 0, -- size of deadzone
+ minmousemove = 3, -- minimum amount of pixeles the mouse has to move between ticks to make the OSC show up
iAmAProgrammer = false, -- use native mpv values and disable OSC internal playlist management (and some functions that depend on it)
}
@@ -1123,10 +1123,15 @@ function render()
mp.set_mouse_area(0, area_y0, osc_param.playresx, area_y1, "showhide")
--mouse input area
- mp.set_mouse_area(
- osc_param.posX - (osc_param.osc_w / 2), osc_param.posY - (osc_param.osc_h / 2),
- osc_param.posX + (osc_param.osc_w / 2), osc_param.posY + (osc_param.osc_h / 2),
- "input")
+ if state.osc_visible then -- activate only when OSC is actually visible
+ mp.set_mouse_area(
+ osc_param.posX - (osc_param.osc_w / 2), osc_param.posY - (osc_param.osc_h / 2),
+ osc_param.posX + (osc_param.osc_w / 2), osc_param.posY + (osc_param.osc_h / 2),
+ "input")
+ mp.enable_key_bindings("input")
+ else
+ mp.disable_key_bindings("input")
+ end
end