diff options
Diffstat (limited to 'scene/main/window.cpp')
-rw-r--r-- | scene/main/window.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/scene/main/window.cpp b/scene/main/window.cpp index 7f2160c6a5..0463615d4d 100644 --- a/scene/main/window.cpp +++ b/scene/main/window.cpp @@ -874,6 +874,10 @@ void Window::child_controls_changed() { call_deferred("_update_child_controls"); } +bool Window::_can_consume_input_events() const { + return exclusive_child == nullptr; +} + void Window::_window_input(const Ref<InputEvent> &p_ev) { if (Engine::get_singleton()->is_editor_hint() && (Object::cast_to<InputEventJoypadButton>(p_ev.ptr()) || Object::cast_to<InputEventJoypadMotion>(*p_ev))) { return; //avoid joy input on editor @@ -890,10 +894,13 @@ void Window::_window_input(const Ref<InputEvent> &p_ev) { if (exclusive_child != nullptr) { exclusive_child->grab_focus(); - return; //has an exclusive child, can't get events until child is closed + if (!is_embedding_subwindows()) { //not embedding, no need for event + return; + } } emit_signal(SceneStringNames::get_singleton()->window_input, p_ev); + input(p_ev); if (!is_input_handled()) { unhandled_input(p_ev); @@ -1244,6 +1251,14 @@ Rect2i Window::get_parent_rect() const { } } +void Window::set_clamp_to_embedder(bool p_enable) { + clamp_to_embedder = p_enable; +} + +bool Window::is_clamped_to_embedder() const { + return clamp_to_embedder; +} + void Window::_bind_methods() { ClassDB::bind_method(D_METHOD("set_title", "title"), &Window::set_title); ClassDB::bind_method(D_METHOD("get_title"), &Window::get_title); |