summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMarkus Sauermann <6299227+Sauermann@users.noreply.github.com>2023-05-29 00:29:44 +0200
committerMarkus Sauermann <6299227+Sauermann@users.noreply.github.com>2023-05-29 02:39:09 +0200
commita9bf3de08ed8ad55858f8a723b6395a68e6bc399 (patch)
treeb49926f26ea3ef2d34b01ade826e9ac387057c74 /tests
parent28cca66d2cfe25d6d7bf5a2a26ab7bd366029669 (diff)
downloadredot-engine-a9bf3de08ed8ad55858f8a723b6395a68e6bc399.tar.gz
Fix InputEvent being used twice
A single mouse click can cause multiple actions, which contradicts the paradigm that a single Input Event should cause only a single action. The solution consists of two parts: 1. Physics Picking as the last step during viewport input event handling, currently doesn't set the event as handled. This PR sets the event as handled in the case of physics picking. 2. After an InputEvent is processed by a SubVieportContainer, it is sent to its parent, even if it set as handled within the SubViewport. This PR adds an additional test to check if the event is handled before propagating the event to the parent Control.
Diffstat (limited to 'tests')
-rw-r--r--tests/scene/test_text_edit.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/tests/scene/test_text_edit.h b/tests/scene/test_text_edit.h
index f3f2b4cb34..67d473128e 100644
--- a/tests/scene/test_text_edit.h
+++ b/tests/scene/test_text_edit.h
@@ -38,6 +38,7 @@
namespace TestTextEdit {
TEST_CASE("[SceneTree][TextEdit] text entry") {
+ SceneTree::get_singleton()->get_root()->set_physics_object_picking(false);
TextEdit *text_edit = memnew(TextEdit);
SceneTree::get_singleton()->get_root()->add_child(text_edit);
text_edit->grab_focus();