summaryrefslogtreecommitdiff
path: root/main.lua
diff options
context:
space:
mode:
authorDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2026-01-20 11:30:39 -0800
committerDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2026-01-20 11:30:39 -0800
commitbc33649c68238f5a4c602a8cc234ba24db678ad3 (patch)
tree58e227b275a3d35e8cb9d379ad8ebe4cea289856 /main.lua
parent50021f8d850b81e7ec27b0e048dafb693fb49a6c (diff)
downloadmpv-iptv-menu-bc33649c68238f5a4c602a8cc234ba24db678ad3.tar.gz
mpv-iptv-menu-bc33649c68238f5a4c602a8cc234ba24db678ad3.tar.xz
disable VO dragging while menu is open
Diffstat (limited to 'main.lua')
-rw-r--r--main.lua5
1 files changed, 5 insertions, 0 deletions
diff --git a/main.lua b/main.lua
index 1f93058..f454034 100644
--- a/main.lua
+++ b/main.lua
@@ -1263,11 +1263,15 @@ end
-- while the OSD is visible. these commands are technically deprecated for
-- non-internal use, but they still work, and there doesn't appear to be
-- another way apart from setting an override for each individual key.
+--
+-- nonexistent `nodrag' section is enabled to disable VO dragging while the
+-- menu is open.
local function set_key_bindings()
if osd:is_hidden() then
if binding_state.bound then
mp.remove_key_binding('mouse_move')
mp.remove_key_binding('unmapped')
+ mp.command_native({'disable-section', 'nodrag'})
mp.command_native({
'enable-section', 'default',
'allow-hide-cursor+allow-vo-dragging'})
@@ -1278,6 +1282,7 @@ local function set_key_bindings()
if not binding_state.bound then
mp.command_native({'disable-section', 'default'})
+ mp.command_native({'enable-section', 'nodrag'})
mp.add_forced_key_binding('MOUSE_MOVE', 'mouse_move') -- noisy
mp.add_forced_key_binding(
'UNMAPPED', 'unmapped', handle_key, {complex = true})