diff options
author | keptsecret <sorchon@gmail.com> | 2022-02-18 11:06:41 -0500 |
---|---|---|
committer | keptsecret <sorchon@gmail.com> | 2022-02-18 11:06:41 -0500 |
commit | cb905fa95708e64376cc334de468f03d83827eb3 (patch) | |
tree | 4eb9a7e26782dbf6a8480ea14ee91de7893716dc | |
parent | 887d4bd0d985979d6c3fb33b053ce99486879956 (diff) |
prevent acceptdialog taking over main editor window when made visible
-rw-r--r-- | scene/main/window.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/scene/main/window.cpp b/scene/main/window.cpp index e7a575f40a..675be9db29 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; |