diff options
author | PouleyKetchoupp <pouleyketchoup@gmail.com> | 2020-10-09 11:20:38 +0200 |
---|---|---|
committer | PouleyKetchoupp <pouleyketchoup@gmail.com> | 2020-10-09 11:20:38 +0200 |
commit | 4686200f0e70b979436af46cae31c8e3199a95ea (patch) | |
tree | b81e1acb92c46490a129d5563852da17623e0920 /scene | |
parent | 67135f246e9967bcdbf0f07ea5c8e0640f499d19 (diff) |
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.
Diffstat (limited to 'scene')
-rw-r--r-- | scene/main/window.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/scene/main/window.cpp b/scene/main/window.cpp index 7c2350d1c0..9f014e8175 100644 --- a/scene/main/window.cpp +++ b/scene/main/window.cpp @@ -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; |