prevent acceptdialog taking over main editor window when made visible

This commit is contained in:
keptsecret 2022-02-18 11:06:41 -05:00
parent 887d4bd0d9
commit cb905fa957
1 changed files with 6 additions and 2 deletions

View File

@ -434,8 +434,12 @@ void Window::set_visible(bool p_visible) {
//update transient exclusive //update transient exclusive
if (transient_parent) { if (transient_parent) {
if (exclusive && visible) { if (exclusive && visible) {
ERR_FAIL_COND_MSG(transient_parent->exclusive_child && transient_parent->exclusive_child != this, "Transient parent has another exclusive child."); #ifdef TOOLS_ENABLED
transient_parent->exclusive_child = this; 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 { } else {
if (transient_parent->exclusive_child == this) { if (transient_parent->exclusive_child == this) {
transient_parent->exclusive_child = nullptr; transient_parent->exclusive_child = nullptr;