From b19ab945acec594a17e8a11cec53eec17ad4c4a5 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Tue, 30 Jun 2020 14:01:10 -0300 Subject: Make dialogs exclusive by default, fixes #37732 Also fix on set_visible, not creating exclusive children as it should. --- scene/main/window.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'scene/main') diff --git a/scene/main/window.cpp b/scene/main/window.cpp index da02f932f1..7f2160c6a5 100644 --- a/scene/main/window.cpp +++ b/scene/main/window.cpp @@ -398,6 +398,18 @@ void Window::set_visible(bool p_visible) { emit_signal(SceneStringNames::get_singleton()->visibility_changed); RS::get_singleton()->viewport_set_active(get_viewport_rid(), visible); + + //update transient exclusive + if (transient_parent) { + if (exclusive && visible) { + ERR_FAIL_COND_MSG(transient_parent->exclusive_child && transient_parent->exclusive_child != this, "Transient parent has another exclusive child."); + transient_parent->exclusive_child = this; + } else { + if (transient_parent->exclusive_child == this) { + transient_parent->exclusive_child = nullptr; + } + } + } } void Window::_clear_transient() { -- cgit v1.2.3