From cb905fa95708e64376cc334de468f03d83827eb3 Mon Sep 17 00:00:00 2001 From: keptsecret Date: Fri, 18 Feb 2022 11:06:41 -0500 Subject: [PATCH 1/2] prevent acceptdialog taking over main editor window when made visible --- scene/main/window.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scene/main/window.cpp b/scene/main/window.cpp index e7a575f40a6..675be9db297 100644 --- a/scene/main/window.cpp +++ b/scene/main/window.cpp @@ -434,8 +434,12 @@ void Window::set_visible(bool p_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; +#ifdef TOOLS_ENABLED + if (!(Engine::get_singleton()->is_editor_hint() && get_tree()->get_edited_scene_root() && get_tree()->get_edited_scene_root()->is_ancestor_of(this))) { +#endif + 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; From 128e98c124d2044d8c78b07afc4be0586ba28f30 Mon Sep 17 00:00:00 2001 From: keptsecret Date: Fri, 18 Feb 2022 13:31:54 -0500 Subject: [PATCH 2/2] fixed wrong ifdef enclosed block --- scene/main/window.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scene/main/window.cpp b/scene/main/window.cpp index 675be9db297..b2078bbd771 100644 --- a/scene/main/window.cpp +++ b/scene/main/window.cpp @@ -436,10 +436,10 @@ void Window::set_visible(bool p_visible) { if (exclusive && visible) { #ifdef TOOLS_ENABLED if (!(Engine::get_singleton()->is_editor_hint() && get_tree()->get_edited_scene_root() && get_tree()->get_edited_scene_root()->is_ancestor_of(this))) { -#endif ERR_FAIL_COND_MSG(transient_parent->exclusive_child && transient_parent->exclusive_child != this, "Transient parent has another exclusive child."); transient_parent->exclusive_child = this; } +#endif } else { if (transient_parent->exclusive_child == this) { transient_parent->exclusive_child = nullptr;