From f95a4bceaa58a51b0a3ff5e16f50bf48b1c814d0 Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 5 Dec 2014 15:55:19 +0100 Subject: osc, dvd, bd: fix mouse state when changing menu modes The flags weren't correctly set, and the mouse cursor remained visible after leaving menu mode. This was apparently broken in 0.7.0 too. Fixes #1316. --- player/discnav.c | 3 ++- player/lua/osc.lua | 10 +++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) (limited to 'player') diff --git a/player/discnav.c b/player/discnav.c index e15ecce7f5..d66b569d4b 100644 --- a/player/discnav.c +++ b/player/discnav.c @@ -125,7 +125,8 @@ void mp_nav_init(struct MPContext *mpctx) MP_VERBOSE(mpctx->nav_state, "enabling\n"); - mp_input_enable_section(mpctx->input, "discnav", 0); + mp_input_enable_section(mpctx->input, "discnav", + MP_INPUT_ALLOW_VO_DRAGGING | MP_INPUT_ALLOW_HIDE_CURSOR); update_state(mpctx); } diff --git a/player/lua/osc.lua b/player/lua/osc.lua index c4f6350a0c..c513843fb6 100644 --- a/player/lua/osc.lua +++ b/player/lua/osc.lua @@ -1853,9 +1853,13 @@ function tick() end end +function do_enable_keybindings() + mp.enable_key_bindings("showhide", "allow-vo-dragging|allow-hide-cursor") +end + function enable_osc(enable) if enable then - mp.enable_key_bindings("showhide") + do_enable_keybindings() show_osc() else hide_osc() @@ -1881,7 +1885,7 @@ mp.observe_property("disc-menu-active", "bool", function(name, val) hide_osc() mp.disable_key_bindings("showhide") else - mp.enable_key_bindings("showhide") + do_enable_keybindings() end end) @@ -1890,7 +1894,7 @@ mp.set_key_bindings({ {"mouse_move", function(e) process_event("mouse_move", nil) end}, {"mouse_leave", mouse_leave}, }, "showhide", "force") -mp.enable_key_bindings("showhide", "allow-vo-dragging|allow-hide-cursor") +do_enable_keybindings() --mouse input bindings mp.set_key_bindings({ -- cgit v1.2.3