diff options
| author | Juan Linietsky | 2016-06-27 11:22:13 -0300 |
|---|---|---|
| committer | Juan Linietsky | 2016-06-27 11:22:13 -0300 |
| commit | 88e28af5e360d826ee0e83944dff0003375e3daf (patch) | |
| tree | ea6a696d16afda66c488f4866f44c39d2d2703e2 /scene/main | |
| parent | d41b7a66e9e01b55310d68e216139d6b6cc712f1 (diff) | |
| download | godot-88e28af5e360d826ee0e83944dff0003375e3daf.tar.gz godot-88e28af5e360d826ee0e83944dff0003375e3daf.tar.zst godot-88e28af5e360d826ee0e83944dff0003375e3daf.zip | |
Add a small workaround to avoid modal tabs to be closed if they are spawned in the same frame, closes #3837
Diffstat (limited to 'scene/main')
| -rw-r--r-- | scene/main/viewport.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp index 76af81c32..f09fac6c7 100644 --- a/scene/main/viewport.cpp +++ b/scene/main/viewport.cpp @@ -1752,8 +1752,9 @@ void Viewport::_gui_input_event(InputEvent p_event) { Vector2 pos = top->get_global_transform_with_canvas().affine_inverse().xform(mpos); if (!top->has_point(pos)) { - if (top->data.modal_exclusive) { + if (top->data.modal_exclusive || top->data.modal_frame==OS::get_singleton()->get_frames_drawn()) { //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()->call_group(SceneTree::GROUP_CALL_REALTIME,"windows","_cancel_input_ID",p_event.ID); get_tree()->set_input_as_handled(); return; // no one gets the event if exclusive NO ONE |
