diff options
Diffstat (limited to 'scene/main/viewport.cpp')
-rw-r--r-- | scene/main/viewport.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp index 8fcf9e84c4..d4496af477 100644 --- a/scene/main/viewport.cpp +++ b/scene/main/viewport.cpp @@ -611,6 +611,7 @@ void Viewport::_notification(int p_what) { gui.mouse_in_viewport = false; _drop_physics_mouseover(); _drop_mouse_over(); + _gui_cancel_tooltip(); // When the mouse exits the viewport, we want to end mouse_over, but // not mouse_focus, because, for example, we want to continue // dragging a scrollbar even if the mouse has left the viewport. @@ -2988,10 +2989,12 @@ void Viewport::push_input(const Ref<InputEvent> &p_event, bool p_local_coords) { } if (!is_input_handled()) { + ERR_FAIL_COND(!is_inside_tree()); get_tree()->_call_input_pause(input_group, SceneTree::CALL_INPUT_TYPE_INPUT, ev, this); //not a bug, must happen before GUI, order is _input -> gui input -> _unhandled input } if (!is_input_handled()) { + ERR_FAIL_COND(!is_inside_tree()); _gui_input_event(ev); } else { // Cleanup internal GUI state after accepting event during _input(). @@ -3036,16 +3039,19 @@ void Viewport::push_unhandled_input(const Ref<InputEvent> &p_event, bool p_local void Viewport::_push_unhandled_input_internal(const Ref<InputEvent> &p_event) { // Shortcut Input. if (Object::cast_to<InputEventKey>(*p_event) != nullptr || Object::cast_to<InputEventShortcut>(*p_event) != nullptr || Object::cast_to<InputEventJoypadButton>(*p_event) != nullptr) { + ERR_FAIL_COND(!is_inside_tree()); get_tree()->_call_input_pause(shortcut_input_group, SceneTree::CALL_INPUT_TYPE_SHORTCUT_INPUT, p_event, this); } // Unhandled Input. if (!is_input_handled()) { + ERR_FAIL_COND(!is_inside_tree()); get_tree()->_call_input_pause(unhandled_input_group, SceneTree::CALL_INPUT_TYPE_UNHANDLED_INPUT, p_event, this); } // Unhandled key Input - Used for performance reasons - This is called a lot less than _unhandled_input since it ignores MouseMotion, and to handle Unicode input with Alt / Ctrl modifiers after handling shortcuts. if (!is_input_handled() && (Object::cast_to<InputEventKey>(*p_event) != nullptr)) { + ERR_FAIL_COND(!is_inside_tree()); get_tree()->_call_input_pause(unhandled_key_input_group, SceneTree::CALL_INPUT_TYPE_UNHANDLED_KEY_INPUT, p_event, this); } |