summaryrefslogtreecommitdiff
path: root/scene/main/viewport.cpp
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2017-10-20 22:47:31 +0200
committerGitHub <noreply@github.com>2017-10-20 22:47:31 +0200
commitf2f75d1f117e52f3f4a033fdf967d35bb3dbaa42 (patch)
tree61b91e29f83a76541586d7820ee5cff9d7351375 /scene/main/viewport.cpp
parent81cd52dfb432cdcb209969f4ab33cc14fd37d700 (diff)
parent5da02a0d9c657aa24f5272f8312783c9871beb85 (diff)
Merge pull request #12149 from endragor/check-input-handled
Check if input is handled before handling it
Diffstat (limited to 'scene/main/viewport.cpp')
-rw-r--r--scene/main/viewport.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp
index 12c8b0d89b..0a02f471c1 100644
--- a/scene/main/viewport.cpp
+++ b/scene/main/viewport.cpp
@@ -2371,8 +2371,13 @@ void Viewport::input(const Ref<InputEvent> &p_event) {
ERR_FAIL_COND(!is_inside_tree());
- get_tree()->_call_input_pause(input_group, "_input", p_event); //not a bug, must happen before GUI, order is _input -> gui input -> _unhandled input
- _gui_input_event(p_event);
+ if (!get_tree()->is_input_handled()) {
+ get_tree()->_call_input_pause(input_group, "_input", p_event); //not a bug, must happen before GUI, order is _input -> gui input -> _unhandled input
+ }
+
+ if (!get_tree()->is_input_handled()) {
+ _gui_input_event(p_event);
+ }
//get_tree()->call_group(SceneTree::GROUP_CALL_REVERSE|SceneTree::GROUP_CALL_REALTIME|SceneTree::GROUP_CALL_MULIILEVEL,gui_input_group,"_gui_input",p_event); //special one for GUI, as controls use their own process check
}