summaryrefslogtreecommitdiff
path: root/scene/main/window.cpp
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2020-07-01 16:28:20 +0200
committerGitHub <noreply@github.com>2020-07-01 16:28:20 +0200
commit2fc3c5bb9f0250cb5caecb79f8dc00c100d1e189 (patch)
treec6c45a4db687fe5ae42019e9f6ac677393f69c4d /scene/main/window.cpp
parent34e011c8a5ba4b9482a44b5601c28c68d65588d3 (diff)
parent239942cfefc51a907b3fe7eff72818b4a7732726 (diff)
Merge pull request #40015 from reduz/fix-embedded_subwindow-input
Ensure embedded mode works again
Diffstat (limited to 'scene/main/window.cpp')
-rw-r--r--scene/main/window.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/scene/main/window.cpp b/scene/main/window.cpp
index 7f2160c6a5..8604bb78ac 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);