Merge pull request #77595 from Sauermann/fix-double-inputevent

Fix InputEvent being used twice
This commit is contained in:
Yuri Sizov 2023-05-30 15:25:36 +02:00 committed by GitHub
commit 3a895eafc0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 0 deletions

View File

@ -1564,6 +1564,11 @@ bool Viewport::_gui_call_input(Control *p_control, const Ref<InputEvent> &p_inpu
} }
} }
if (is_input_handled()) {
// Break after Physics Picking in SubViewport.
break;
}
if (ci->is_set_as_top_level()) { if (ci->is_set_as_top_level()) {
break; break;
} }
@ -3045,6 +3050,7 @@ void Viewport::push_unhandled_input(const Ref<InputEvent> &p_event, bool p_local
)) { )) {
physics_picking_events.push_back(ev); physics_picking_events.push_back(ev);
set_input_as_handled();
} }
} }
} }

View File

@ -38,6 +38,7 @@
namespace TestTextEdit { namespace TestTextEdit {
TEST_CASE("[SceneTree][TextEdit] text entry") { TEST_CASE("[SceneTree][TextEdit] text entry") {
SceneTree::get_singleton()->get_root()->set_physics_object_picking(false);
TextEdit *text_edit = memnew(TextEdit); TextEdit *text_edit = memnew(TextEdit);
SceneTree::get_singleton()->get_root()->add_child(text_edit); SceneTree::get_singleton()->get_root()->add_child(text_edit);
text_edit->grab_focus(); text_edit->grab_focus();