Repository: godotengine/godot
File: editor/editor_node.cpp (C++)

Code before:

		OS::get_singleton()->benchmark_end_measure("Editor", "First Scan");

		// Reload the global shader variables, but this time
		// loading textures, as they are now properly imported.
		RenderingServer::get_singleton()->global_shader_parameters_load_settings(true);

		_load_editor_layout();

		if (!defer_load_scene.is_empty()) {
			OS::get_singleton()->benchmark_begin_measure("Editor", "Load Scene");

			load_scene(defer_load_scene);
			defer_load_scene = "";

			OS::get_singleton()->benchmark_end_measure("Editor", "Load Scene");
			OS::get_singleton()->benchmark_dump();
		}

		// Start preview thread now that it's safe.
		if (!singleton->cmdline_mode) {
			EditorResourcePreview::get_singleton()->start();
		}

		// Set initial focus for screen reader users.
		if (DisplayServer::get_singleton()->accessibility_screen_reader_active() == 1) {
			SceneTreeDock::get_singleton()->get_tree_editor()->get_scene_tree()->grab_focus();
		}

		get_tree()->create_timer(1.0f)->connect("timeout", callable_mp(this, &EditorNode::_remove_lock_file));
	}
}

void EditorNode::_remove_lock_file() {
	OS::get_singleton()->remove_lock_file();
}

void EditorNode::_scan_external_changes() {
	disk_changed_list->clear();
	TreeItem *r = disk_changed_list->create_item();
	disk_changed_list->set_hide_root(true);
	bool need_reload = false;

	disk_changed_scenes.clear();
	disk_changed_project = false;

	// Check if any edited scene has changed.
	for (int i = 0; i < editor_data.get_edited_scene_count(); i++) {
		Ref<DirAccess> da = DirAccess::create(DirAccess::ACCESS_RESOURCES);

		const String scene_path = editor_data.get_scene_path(i);

Review comment (suggestion):
```suggestion
		if (get_tree()->is_accessibility_enabled()) {
```
It's mostly the same, but do some extra checks.

Code after:
	}
}

void EditorNode::_sources_changed(bool p_exist) {
	if (waiting_for_first_scan) {
		waiting_for_first_scan = false;

		OS::get_singleton()->benchmark_end_measure("Editor", "First Scan");

		// Reload the global shader variables, but this time
		// loading textures, as they are now properly imported.
		RenderingServer::get_singleton()->global_shader_parameters_load_settings(true);

		_load_editor_layout();

		if (!defer_load_scene.is_empty()) {
			OS::get_singleton()->benchmark_begin_measure("Editor", "Load Scene");

			load_scene(defer_load_scene);
			defer_load_scene = "";

			OS::get_singleton()->benchmark_end_measure("Editor", "Load Scene");
			OS::get_singleton()->benchmark_dump();
		}

		// Start preview thread now that it's safe.
		if (!singleton->cmdline_mode) {
			EditorResourcePreview::get_singleton()->start();
		}

		// Set initial focus for screen reader users.
		if (get_tree()->is_accessibility_enabled()) {
			if (SceneTreeDock::get_singleton()->is_visible_in_tree()) {
				SceneTreeDock::get_singleton()->get_tree_editor()->get_scene_tree()->grab_focus();
			} else {
				TabContainer *tab_container = EditorDockManager::get_singleton()->get_dock_tab_container(SceneTreeDock::get_singleton());
				if (tab_container) {
					// Another tab is active (e.g., Import) - focus the tab bar so user can switch.
					tab_container->get_tab_bar()->grab_focus();
				}
			}
		}

		get_tree()->create_timer(1.0f)->connect("timeout", callable_mp(this, &EditorNode::_remove_lock_file));
	}
}

void EditorNode::_remove_lock_file() {
	OS::get_singleton()->remove_lock_file();
}