2
0
Fork 0

Fix Popup crash in single window mode

focus_target->exclusive_child could be invalidated during the call to
focus_target->grab_focus(), now using the same logic with safe accesses
to focus_target.
4.0
PouleyKetchoupp 2020-10-09 11:20:38 +07:00
parent 67135f246e
commit 4686200f0e
1 changed files with 2 additions and 2 deletions

@ -895,11 +895,11 @@ void Window::_window_input(const Ref<InputEvent> &p_ev) {
if (exclusive_child != nullptr) {
Window *focus_target = exclusive_child;
focus_target->grab_focus();
while (focus_target->exclusive_child != nullptr) {
focus_target->grab_focus();
focus_target = focus_target->exclusive_child;
focus_target->grab_focus();
}
focus_target->grab_focus();
if (!is_embedding_subwindows()) { //not embedding, no need for event
return;