summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilip Langdale <philipl@overt.org>2019-12-03 21:41:04 +0800
committerPhilip Langdale <philipl@overt.org>2019-12-04 09:32:25 +0800
commitf8689eff6d8c982ed970f02929a50be1406e1e25 (patch)
tree2e6fc8bbedb21e80fbc646ab3bcc90c321a24203
parent7f300a00e929bd728c6cbff27b68bbbf28e85d0f (diff)
downloadmpv-f8689eff6d8c982ed970f02929a50be1406e1e25.tar.bz2
mpv-f8689eff6d8c982ed970f02929a50be1406e1e25.tar.xz
osc: ensure that window control show/hide zone is handled dynamically
As preparation for adding the auto mode for window controls, we need to make sure that the controls can be successfully toggled at runtime, rather than only being able to configure them once at startup. Right now, there is a problem with the handling of the show/hide zone for the window controls. The previous fix for #7212 was to avoid registering the input mapping for the window control show/hide zone. If there is no input mapping, then there is no input, and the zone is a no-op, even if it exists. But this only happens at startup. After that point, the input mapping doesn't exist and cannot be turned on. In this change, I'm switching the approach; we now go back to always registering the input mapping, and instead, we zero out the show/hide zone if window controls are disabled, and set its size appropriately if they are enabled.
-rw-r--r--player/lua/osc.lua12
1 files changed, 6 insertions, 6 deletions
diff --git a/player/lua/osc.lua b/player/lua/osc.lua
index 8223bc77c1..13ceb43089 100644
--- a/player/lua/osc.lua
+++ b/player/lua/osc.lua
@@ -2218,6 +2218,8 @@ function render()
for k,cords in pairs(osc_param.areas["showhide_wc"]) do
set_virt_mouse_area(cords.x1, cords.y1, cords.x2, cords.y2, "showhide_wc")
end
+ else
+ set_virt_mouse_area(0, 0, 0, 0, "showhide_wc")
end
do_enable_keybindings()
@@ -2489,12 +2491,10 @@ mp.set_key_bindings({
{"mouse_move", function(e) process_event("mouse_move", nil) end},
{"mouse_leave", mouse_leave},
}, "showhide", "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
+mp.set_key_bindings({
+ {"mouse_move", function(e) process_event("mouse_move", nil) end},
+ {"mouse_leave", mouse_leave},
+}, "showhide_wc", "force")
do_enable_keybindings()
--mouse input bindings