diff options
| author | Bernhard Liebl | 2017-11-22 09:43:40 +0100 |
|---|---|---|
| committer | Bernhard Liebl | 2017-12-10 10:55:48 +0100 |
| commit | efc3ffb816796fbab64d389508d837560b4f220c (patch) | |
| tree | 77e171cd720c8fd77a9883fad0dfe7eedc9257a3 /scene/main/viewport.cpp | |
| parent | d055031c73ebce375f3b0087baf9ba617fc996aa (diff) | |
| download | godot-efc3ffb816796fbab64d389508d837560b4f220c.tar.gz godot-efc3ffb816796fbab64d389508d837560b4f220c.tar.zst godot-efc3ffb816796fbab64d389508d837560b4f220c.zip | |
fix certain popup close clicks with popup buttons
Diffstat (limited to 'scene/main/viewport.cpp')
| -rw-r--r-- | scene/main/viewport.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp index a785abbc6..8bf54232b 100644 --- a/scene/main/viewport.cpp +++ b/scene/main/viewport.cpp @@ -1649,6 +1649,8 @@ void Viewport::_gui_input_event(Ref<InputEvent> p_event) { } else { + bool is_handled = false; + _gui_sort_modal_stack(); while (!gui.modal_stack.empty()) { @@ -1666,11 +1668,20 @@ void Viewport::_gui_input_event(Ref<InputEvent> p_event) { top->notification(Control::NOTIFICATION_MODAL_CLOSE); top->_modal_stack_remove(); top->hide(); + + if (!top->pass_on_modal_close_click()) { + is_handled = true; + } } else { break; } } + if (is_handled) { + get_tree()->set_input_as_handled(); + return; + } + //Matrix32 parent_xform; /* |
