mirror of
https://github.com/godotengine/godot.git
synced 2025-12-07 22:00:10 +00:00
Merge pull request #110162 from bruvzg/m_cli
Fix out of control area mouse events crash, if nothing have mouse focus.
This commit is contained in:
commit
462a8d65bf
1 changed files with 4 additions and 0 deletions
|
|
@ -1902,6 +1902,10 @@ void Viewport::_gui_input_event(Ref<InputEvent> p_event) {
|
|||
}
|
||||
MouseButtonMask button_mask = mouse_button_to_mask(mb->get_button_index());
|
||||
if (!gui.mouse_focus_mask.is_empty() && !gui.mouse_focus_mask.has_flag(button_mask)) {
|
||||
if (!gui.mouse_focus) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Do not steal mouse focus and stuff while a focus mask without the current mouse button exists.
|
||||
gui.mouse_focus_mask.set_flag(button_mask);
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue