1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-07 12:30:27 +00:00

Stop EditorNode from refreshing the current scene tab when not needed

This commit is contained in:
chocola-mint
2024-12-17 17:09:36 +09:00
parent 4364ed6ccd
commit 86a6794a4a

View File

@@ -1111,7 +1111,14 @@ void EditorNode::_resources_reimported(const Vector<String> &p_resources) {
ap->stop(true);
}
// Only refresh the current scene tab if it's been reimported.
// Otherwise the scene tab will try to grab focus unnecessarily.
bool should_refresh_current_scene_tab = false;
const String current_scene_tab = editor_data.get_scene_path(current_tab);
for (const String &E : scenes_reimported) {
if (!should_refresh_current_scene_tab && E == current_scene_tab) {
should_refresh_current_scene_tab = true;
}
reload_scene(E);
}
@@ -1121,8 +1128,10 @@ void EditorNode::_resources_reimported(const Vector<String> &p_resources) {
scenes_reimported.clear();
resources_reimported.clear();
if (should_refresh_current_scene_tab) {
_set_current_scene_nocheck(current_tab);
}
}
void EditorNode::_sources_changed(bool p_exist) {
if (waiting_for_first_scan) {