summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2017-12-20 18:03:48 -0300
committerJuan Linietsky <reduzio@gmail.com>2017-12-20 18:03:48 -0300
commitfeef500b391b492959b2db3a7699ad14c6a37892 (patch)
treed26e153c9a4d99b82dabacf52bb89517c2ccbb6c /scene
parentc9d88fd8e8461cc1d5f83281e8d64ef10a5f02c6 (diff)
properly send mouse released event when grabbing modal focus, fixes #14854
Diffstat (limited to 'scene')
-rw-r--r--scene/main/viewport.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp
index ae855e803c..c156b0df31 100644
--- a/scene/main/viewport.cpp
+++ b/scene/main/viewport.cpp
@@ -2371,7 +2371,17 @@ List<Control *>::Element *Viewport::_gui_show_modal(Control *p_control) {
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);
+ Ref<InputEventMouseButton> mb;
+ mb.instance();
+ mb->set_position(gui.mouse_focus->get_local_mouse_position());
+ mb->set_global_position(gui.mouse_focus->get_local_mouse_position());
+ mb->set_button_index(gui.mouse_focus_button);
+ mb->set_pressed(false);
+ gui.mouse_focus->call_multilevel(SceneStringNames::get_singleton()->_gui_input, mb);
+
+ //if (gui.mouse_over == gui.mouse_focus) {
+ // gui.mouse_focus->notification(Control::NOTIFICATION_MOUSE_EXIT);
+ //}
gui.mouse_focus = NULL;
}