diff --git a/scene/main/window.cpp b/scene/main/window.cpp index 7c2350d1c0f..9f014e8175c 100644 --- a/scene/main/window.cpp +++ b/scene/main/window.cpp @@ -895,11 +895,11 @@ void Window::_window_input(const Ref &p_ev) { if (exclusive_child != nullptr) { 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(); + while (focus_target->exclusive_child != nullptr) { + focus_target = focus_target->exclusive_child; + focus_target->grab_focus(); + } if (!is_embedding_subwindows()) { //not embedding, no need for event return;