summaryrefslogtreecommitdiff
path: root/scene/main
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2017-12-19 09:55:01 -0300
committerJuan Linietsky <reduzio@gmail.com>2017-12-19 09:58:02 -0300
commit1eb1837d0cf95c2c12d8ec51127e222f6f4888c5 (patch)
tree4dde3abbe494f244efdc5f308c8d97439a80d266 /scene/main
parent49eea481ec962111f1436564096fdbe64d06de9c (diff)
Should no longer crash after rebaking, may be a solution to #14795
Not sure if this is the same problem, as reported, please test.
Diffstat (limited to 'scene/main')
-rw-r--r--scene/main/viewport.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp
index f5d7043a40..ae855e803c 100644
--- a/scene/main/viewport.cpp
+++ b/scene/main/viewport.cpp
@@ -1659,6 +1659,7 @@ void Viewport::_gui_input_event(Ref<InputEvent> p_event) {
//cancel event, sorry, modal exclusive EATS UP ALL
//alternative, you can't pop out a window the same frame it was made modal (fixes many issues)
get_tree()->set_input_as_handled();
+
return; // no one gets the event if exclusive NO ONE
}
@@ -2348,7 +2349,6 @@ void Viewport::_gui_control_grab_focus(Control *p_control) {
//no need for change
if (gui.key_focus && gui.key_focus == p_control)
return;
-
get_tree()->call_group_flags(SceneTree::GROUP_CALL_REALTIME, "_viewports", "_gui_remove_focus");
gui.key_focus = p_control;
p_control->notification(Control::NOTIFICATION_FOCUS_ENTER);
@@ -2370,6 +2370,11 @@ List<Control *>::Element *Viewport::_gui_show_modal(Control *p_control) {
else
p_control->_modal_set_prev_focus_owner(0);
+ if (gui.mouse_focus && !p_control->is_a_parent_of(gui.mouse_focus)) {
+ gui.mouse_focus->notification(Control::NOTIFICATION_MOUSE_EXIT);
+ gui.mouse_focus = NULL;
+ }
+
return gui.modal_stack.back();
}