summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbruvzg <7645683+bruvzg@users.noreply.github.com>2020-07-09 11:18:56 +0300
committerbruvzg <7645683+bruvzg@users.noreply.github.com>2020-07-09 11:18:56 +0300
commit9ffc1c19ad03026bb855b9fd25d21ab4bf83be05 (patch)
tree6ce220839538f91e9fa8df7fa62edcbf3cbe06f7
parent18c51d3f0c4ddf0bdf347638ca2d781a42de16d2 (diff)
downloadredot-engine-9ffc1c19ad03026bb855b9fd25d21ab4bf83be05.tar.gz
Fix exclusive child focus grab, when there are more than two child windows.
-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;