diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2020-07-09 11:09:33 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-09 11:09:33 +0200 |
commit | 25858f360701e7db73852744f0053d8132be537f (patch) | |
tree | 54bc2621669cf393da0a25baa4e4cbc7b9c00f83 | |
parent | 3169fe75e8b62a77c07ff5e088c3d197852d8189 (diff) | |
parent | 9ffc1c19ad03026bb855b9fd25d21ab4bf83be05 (diff) |
Merge pull request #40226 from bruvzg/deep_exclusive_child_fix
Fix exclusive child focus grab, when there are more than two child windows.
-rw-r--r-- | scene/main/window.cpp | 7 |
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; |