summaryrefslogtreecommitdiff
path: root/scene/main/window.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'scene/main/window.cpp')
-rw-r--r--scene/main/window.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/scene/main/window.cpp b/scene/main/window.cpp
index ae30972558..81f33d74fe 100644
--- a/scene/main/window.cpp
+++ b/scene/main/window.cpp
@@ -893,7 +893,12 @@ void Window::_window_input(const Ref<InputEvent> &p_ev) {
}
if (exclusive_child != nullptr) {
- exclusive_child->grab_focus();
+ Window *focus_target = exclusive_child;
+ while (focus_target->exclusive_child != nullptr) {
+ focus_target->grab_focus();
+ focus_target = focus_target->exclusive_child;
+ }
+ focus_target->grab_focus();
if (!is_embedding_subwindows()) { //not embedding, no need for event
return;