From 9ffc1c19ad03026bb855b9fd25d21ab4bf83be05 Mon Sep 17 00:00:00 2001 From: bruvzg <7645683+bruvzg@users.noreply.github.com> Date: Thu, 9 Jul 2020 11:18:56 +0300 Subject: [PATCH] Fix exclusive child focus grab, when there are more than two child windows. --- scene/main/window.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scene/main/window.cpp b/scene/main/window.cpp index ae309725581..81f33d74fef 100644 --- a/scene/main/window.cpp +++ b/scene/main/window.cpp @@ -893,7 +893,12 @@ void Window::_window_input(const Ref &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;