Skip to content

Commit b7aba73

Browse files
committed
Fix files modified outside Godot dialog exclusive window conflict
1 parent 0245871 commit b7aba73

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

editor/editor_node.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5785,9 +5785,9 @@ void EditorNode::_cancel_close_scene_tab() {
57855785
}
57865786
}
57875787

5788-
void EditorNode::_prepare_save_confirmation_popup() {
5789-
if (save_confirmation->get_window() != get_last_exclusive_window()) {
5790-
save_confirmation->reparent(get_last_exclusive_window());
5788+
void EditorNode::_prepare_confirmation_dialog(ConfirmationDialog *dialog) {
5789+
if (dialog->get_window() != get_last_exclusive_window()) {
5790+
dialog->reparent(get_last_exclusive_window());
57915791
}
57925792
}
57935793

@@ -7802,7 +7802,7 @@ EditorNode::EditorNode() {
78027802
save_confirmation->connect(SceneStringName(confirmed), callable_mp(this, &EditorNode::_menu_confirm_current));
78037803
save_confirmation->connect("custom_action", callable_mp(this, &EditorNode::_discard_changes));
78047804
save_confirmation->connect("canceled", callable_mp(this, &EditorNode::_cancel_close_scene_tab));
7805-
save_confirmation->connect("about_to_popup", callable_mp(this, &EditorNode::_prepare_save_confirmation_popup));
7805+
save_confirmation->connect("about_to_popup", callable_mp(this, &EditorNode::_prepare_confirmation_dialog).bind(save_confirmation));
78067806

78077807
gradle_build_manage_templates = memnew(ConfirmationDialog);
78087808
gradle_build_manage_templates->set_text(TTR("Android build template is missing, please install relevant templates."));
@@ -7916,6 +7916,7 @@ EditorNode::EditorNode() {
79167916

79177917
disk_changed->add_button(TTR("Ignore external changes"), !DisplayServer::get_singleton()->get_swap_cancel_ok(), "resave");
79187918
disk_changed->connect("custom_action", callable_mp(this, &EditorNode::_resave_scenes));
7919+
disk_changed->connect("about_to_popup", callable_mp(this, &EditorNode::_prepare_confirmation_dialog).bind(disk_changed));
79197920
}
79207921

79217922
gui_base->add_child(disk_changed);

editor/editor_node.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,7 @@ class EditorNode : public Node {
578578
void _scene_tab_closed(int p_tab);
579579
void _cancel_close_scene_tab();
580580

581-
void _prepare_save_confirmation_popup();
581+
void _prepare_confirmation_dialog(ConfirmationDialog *dialog);
582582

583583
void _inherit_request(String p_file);
584584
void _instantiate_request(const Vector<String> &p_files);

0 commit comments

Comments
 (0)