You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-12-31 18:41:20 +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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user