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.
This commit is contained in:
wm4 2014-12-05 15:55:19 +01:00
parent 254c60e608
commit f95a4bceaa
2 changed files with 9 additions and 4 deletions

View File

@ -125,7 +125,8 @@ void mp_nav_init(struct MPContext *mpctx)
MP_VERBOSE(mpctx->nav_state, "enabling\n"); 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); update_state(mpctx);
} }

View File

@ -1853,9 +1853,13 @@ function tick()
end end
end end
function do_enable_keybindings()
mp.enable_key_bindings("showhide", "allow-vo-dragging|allow-hide-cursor")
end
function enable_osc(enable) function enable_osc(enable)
if enable then if enable then
mp.enable_key_bindings("showhide") do_enable_keybindings()
show_osc() show_osc()
else else
hide_osc() hide_osc()
@ -1881,7 +1885,7 @@ mp.observe_property("disc-menu-active", "bool", function(name, val)
hide_osc() hide_osc()
mp.disable_key_bindings("showhide") mp.disable_key_bindings("showhide")
else else
mp.enable_key_bindings("showhide") do_enable_keybindings()
end end
end) end)
@ -1890,7 +1894,7 @@ mp.set_key_bindings({
{"mouse_move", function(e) process_event("mouse_move", nil) end}, {"mouse_move", function(e) process_event("mouse_move", nil) end},
{"mouse_leave", mouse_leave}, {"mouse_leave", mouse_leave},
}, "showhide", "force") }, "showhide", "force")
mp.enable_key_bindings("showhide", "allow-vo-dragging|allow-hide-cursor") do_enable_keybindings()
--mouse input bindings --mouse input bindings
mp.set_key_bindings({ mp.set_key_bindings({