From c9422b9c235b1d68dd513a2cc34592b4feb8061b Mon Sep 17 00:00:00 2001 From: Shiqing Date: Thu, 11 Jul 2019 17:40:42 +0800 Subject: [PATCH] Fix #29478 multiple modals possibly freeze (cherry picked from commit c16e764bb2ae2f038abac8b1fc2518bba3dbf3db) --- scene/main/viewport.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp index e31939215e6..038aedd8768 100644 --- a/scene/main/viewport.cpp +++ b/scene/main/viewport.cpp @@ -2561,7 +2561,7 @@ void Viewport::_drop_mouse_focus() { List::Element *Viewport::_gui_show_modal(Control *p_control) { - gui.modal_stack.push_back(p_control); + List::Element *node = gui.modal_stack.push_back(p_control); if (gui.key_focus) p_control->_modal_set_prev_focus_owner(gui.key_focus->get_instance_id()); else @@ -2572,7 +2572,7 @@ List::Element *Viewport::_gui_show_modal(Control *p_control) { _drop_mouse_focus(); } - return gui.modal_stack.back(); + return node; } Control *Viewport::_gui_get_focus_owner() {