Merge pull request #58282 from keptsecret/filedialog_visibility_unresponsive

Fix to prevent AcceptDialog and children class taking over main window
This commit is contained in:
Rémi Verschelde 2022-02-28 12:48:59 +01:00 committed by GitHub
commit 345b4bb86a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -436,8 +436,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))) {
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;