Browse Source

Merge pull request #40226 from bruvzg/deep_exclusive_child_fix

Fix exclusive child focus grab, when there are more than two child windows.
Rémi Verschelde 5 years ago
parent
commit
25858f3607
1 changed files with 6 additions and 1 deletions
  1. 6 1
      scene/main/window.cpp

+ 6 - 1
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;