From 5cf9afb0c0409c1115c5b090371c6c81379315d9 Mon Sep 17 00:00:00 2001 From: kobewi Date: Sun, 4 Aug 2024 22:31:10 +0200 Subject: [PATCH] Don't fold resources when child of main inspector exits --- editor/editor_properties.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/editor/editor_properties.cpp b/editor/editor_properties.cpp index fdb4ec170b8..f00f5602cce 100644 --- a/editor/editor_properties.cpp +++ b/editor/editor_properties.cpp @@ -3417,7 +3417,8 @@ void EditorPropertyResource::_notification(int p_what) { switch (p_what) { case NOTIFICATION_EXIT_TREE: { const EditorInspector *ei = get_parent_inspector(); - if (ei && !ei->is_main_editor_inspector()) { + const EditorInspector *main_ei = InspectorDock::get_inspector_singleton(); + if (ei && main_ei && ei != main_ei && !main_ei->is_ancestor_of(ei)) { fold_resource(); } } break;