Fix #29478 multiple modals possibly freeze

(cherry picked from commit c16e764bb2)
This commit is contained in:
Shiqing 2019-07-11 17:40:42 +08:00 committed by Rémi Verschelde
parent e17a57d88a
commit c9422b9c23
1 changed files with 2 additions and 2 deletions

View File

@ -2561,7 +2561,7 @@ void Viewport::_drop_mouse_focus() {
List<Control *>::Element *Viewport::_gui_show_modal(Control *p_control) { List<Control *>::Element *Viewport::_gui_show_modal(Control *p_control) {
gui.modal_stack.push_back(p_control); List<Control *>::Element *node = gui.modal_stack.push_back(p_control);
if (gui.key_focus) if (gui.key_focus)
p_control->_modal_set_prev_focus_owner(gui.key_focus->get_instance_id()); p_control->_modal_set_prev_focus_owner(gui.key_focus->get_instance_id());
else else
@ -2572,7 +2572,7 @@ List<Control *>::Element *Viewport::_gui_show_modal(Control *p_control) {
_drop_mouse_focus(); _drop_mouse_focus();
} }
return gui.modal_stack.back(); return node;
} }
Control *Viewport::_gui_get_focus_owner() { Control *Viewport::_gui_get_focus_owner() {