Skip to content

Commit 462a8d6

Browse files
committed
Merge pull request godotengine#110162 from bruvzg/m_cli
Fix out of control area mouse events crash, if nothing have mouse focus.
2 parents eafc21f + 2273c10 commit 462a8d6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

scene/main/viewport.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1902,6 +1902,10 @@ void Viewport::_gui_input_event(Ref<InputEvent> p_event) {
19021902
}
19031903
MouseButtonMask button_mask = mouse_button_to_mask(mb->get_button_index());
19041904
if (!gui.mouse_focus_mask.is_empty() && !gui.mouse_focus_mask.has_flag(button_mask)) {
1905+
if (!gui.mouse_focus) {
1906+
return;
1907+
}
1908+
19051909
// Do not steal mouse focus and stuff while a focus mask without the current mouse button exists.
19061910
gui.mouse_focus_mask.set_flag(button_mask);
19071911
} else {

0 commit comments

Comments
 (0)