From 55711b2ee849163135640cda0f00fcdcb0819af5 Mon Sep 17 00:00:00 2001 From: kit Date: Wed, 17 Apr 2024 14:32:27 -0400 Subject: [PATCH] Don't edit current when changing docks --- editor/editor_dock_manager.cpp | 1 - editor/editor_inspector.cpp | 7 ++++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/editor/editor_dock_manager.cpp b/editor/editor_dock_manager.cpp index b6250671ee1..06dd33d8abd 100644 --- a/editor/editor_dock_manager.cpp +++ b/editor/editor_dock_manager.cpp @@ -147,7 +147,6 @@ void EditorDockManager::_update_layout() { if (!dock_context_popup->is_inside_tree() || EditorNode::get_singleton()->is_exiting()) { return; } - EditorNode::get_singleton()->edit_current(); dock_context_popup->docks_updated(); _update_docks_menu(); EditorNode::get_singleton()->save_editor_layout_delayed(); diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp index aed1462eb61..9d75c32b730 100644 --- a/editor/editor_inspector.cpp +++ b/editor/editor_inspector.cpp @@ -3468,7 +3468,9 @@ void EditorInspector::edit(Object *p_object) { next_object = p_object; // Some plugins need to know the next edited object when clearing the inspector. if (object) { _clear(); - object->disconnect("property_list_changed", callable_mp(this, &EditorInspector::_changed_callback)); + if (object->is_connected("property_list_changed", callable_mp(this, &EditorInspector::_changed_callback))) { + object->disconnect("property_list_changed", callable_mp(this, &EditorInspector::_changed_callback)); + } } per_array_page.clear(); @@ -4010,14 +4012,13 @@ void EditorInspector::_notification(int p_what) { } break; case NOTIFICATION_PREDELETE: { - edit(nullptr); //just in case + edit(nullptr); } break; case NOTIFICATION_EXIT_TREE: { if (!sub_inspector) { get_tree()->disconnect("node_removed", callable_mp(this, &EditorInspector::_node_removed)); } - edit(nullptr); } break; case NOTIFICATION_VISIBILITY_CHANGED: {