Browse Source

Revert "Don't edit current when changing docks"

This reverts commit 55711b2ee849163135640cda0f00fcdcb0819af5.
Fixes #91046.
Rémi Verschelde 1 year ago
parent
commit
2ad43045a3
2 changed files with 4 additions and 4 deletions
  1. 1 0
      editor/editor_dock_manager.cpp
  2. 3 4
      editor/editor_inspector.cpp

+ 1 - 0
editor/editor_dock_manager.cpp

@@ -147,6 +147,7 @@ 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();

+ 3 - 4
editor/editor_inspector.cpp

@@ -3477,9 +3477,7 @@ 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();
-		if (object->is_connected("property_list_changed", callable_mp(this, &EditorInspector::_changed_callback))) {
-			object->disconnect("property_list_changed", callable_mp(this, &EditorInspector::_changed_callback));
-		}
+		object->disconnect("property_list_changed", callable_mp(this, &EditorInspector::_changed_callback));
 	}
 	per_array_page.clear();
 
@@ -4021,13 +4019,14 @@ void EditorInspector::_notification(int p_what) {
 		} break;
 
 		case NOTIFICATION_PREDELETE: {
-			edit(nullptr);
+			edit(nullptr); //just in case
 		} 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: {