diff options
author | AlexanderFarkas <sashafarkas322@gmail.com> | 2024-05-04 14:22:35 +0300 |
---|---|---|
committer | AlexanderFarkas <sashafarkas322@gmail.com> | 2024-05-08 13:42:45 +0300 |
commit | bc19b79776650c27f57e7634b211a4bc9ee88584 (patch) | |
tree | ea0c32f2fce570668ec3ffcc9ba726f22c4ef791 /editor/editor_node.cpp | |
parent | 7ebc866418b075df58cbe4e31fcf8b0c3acd70a1 (diff) | |
download | redot-engine-bc19b79776650c27f57e7634b211a4bc9ee88584.tar.gz |
Remove error messages caused by Save on Focus feature
Fixes #73765.
Diffstat (limited to 'editor/editor_node.cpp')
-rw-r--r-- | editor/editor_node.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 5bb9aa91d2..e487a9e781 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -752,7 +752,7 @@ void EditorNode::_notification(int p_what) { case NOTIFICATION_APPLICATION_FOCUS_OUT: { // Save on focus loss before applying the FPS limit to avoid slowing down the saving process. if (EDITOR_GET("interface/editor/save_on_focus_loss")) { - _menu_option_confirm(FILE_SAVE_SCENE, false); + _menu_option_confirm(FILE_SAVE_SCENE_SILENTLY, false); } // Set a low FPS cap to decrease CPU/GPU usage while the editor is unfocused. @@ -2666,6 +2666,16 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) { case FILE_CLOSE: { _scene_tab_closed(editor_data.get_edited_scene()); } break; + case FILE_SAVE_SCENE_SILENTLY: { + // Save scene without displaying progress dialog. Used to work around + // errors about parent node being busy setting up children + // when Save on Focus Loss kicks in. + Node *scene = editor_data.get_edited_scene_root(); + if (scene && !scene->get_scene_file_path().is_empty() && DirAccess::exists(scene->get_scene_file_path().get_base_dir())) { + _save_scene(scene->get_scene_file_path()); + save_editor_layout_delayed(); + } + } break; case SCENE_TAB_CLOSE: case FILE_SAVE_SCENE: { int scene_idx = (p_option == FILE_SAVE_SCENE) ? -1 : tab_closing_idx; |