mirror of
https://github.com/mpv-player/mpv
synced 2024-12-26 08:52:48 +00:00
input: set mouse area by default for all input
Otherwise, mouse button bindings added by mp.add_key_binding() would be ignored. It's possible that this "breaks" some older scripts using undocumented Lua script functions, but it should be safe otherwise. Fixes #1283.
This commit is contained in:
parent
1eeca36d5f
commit
4cdd346246
@ -362,6 +362,8 @@ static struct cmd_bind_section *get_bind_section(struct input_ctx *ictx,
|
||||
}
|
||||
*bind_section = (struct cmd_bind_section) {
|
||||
.section = bstrdup0(bind_section, section),
|
||||
.mouse_area = {INT_MIN, INT_MIN, INT_MAX, INT_MAX},
|
||||
.mouse_area_set = true,
|
||||
};
|
||||
return bind_section;
|
||||
}
|
||||
@ -1223,7 +1225,6 @@ struct input_ctx *mp_input_init(struct mpv_global *global)
|
||||
// Setup default section, so that it does nothing.
|
||||
mp_input_enable_section(ictx, NULL, MP_INPUT_ALLOW_VO_DRAGGING |
|
||||
MP_INPUT_ALLOW_HIDE_CURSOR);
|
||||
mp_input_set_section_mouse_area(ictx, NULL, INT_MIN, INT_MIN, INT_MAX, INT_MAX);
|
||||
|
||||
return ictx;
|
||||
}
|
||||
|
@ -112,7 +112,7 @@ local function update_key_bindings()
|
||||
end
|
||||
mp.input_define_section(section, cfg, flags)
|
||||
-- TODO: remove the section if the script is stopped
|
||||
mp.input_enable_section(section)
|
||||
mp.input_enable_section(section, "allow-hide-cursor|allow-vo-dragging")
|
||||
end
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user