diff options
Diffstat (limited to 'editor/project_manager.cpp')
-rw-r--r-- | editor/project_manager.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/editor/project_manager.cpp b/editor/project_manager.cpp index 87d008d144..78f6fe58d0 100644 --- a/editor/project_manager.cpp +++ b/editor/project_manager.cpp @@ -1057,6 +1057,8 @@ public: } }; + bool project_opening_initiated; + ProjectList(); ~ProjectList(); @@ -1136,6 +1138,7 @@ ProjectList::ProjectList() { add_child(_scroll_children); _icon_load_index = 0; + project_opening_initiated = false; } ProjectList::~ProjectList() { @@ -1818,7 +1821,9 @@ void ProjectList::_panel_input(const Ref<InputEvent> &p_ev, Node *p_hb) { emit_signal(SNAME(SIGNAL_SELECTION_CHANGED)); - if (!mb->is_ctrl_pressed() && mb->is_double_click()) { + // Do not allow opening a project more than once using a single project manager instance. + // Opening the same project in several editor instances at once can lead to various issues. + if (!mb->is_ctrl_pressed() && mb->is_double_click() && !project_opening_initiated) { emit_signal(SNAME(SIGNAL_PROJECT_ASK_OPEN)); } } @@ -2140,6 +2145,8 @@ void ProjectManager::_open_selected_projects() { ERR_FAIL_COND(err); } + _project_list->project_opening_initiated = true; + _dim_window(); get_tree()->quit(); } @@ -2566,7 +2573,7 @@ ProjectManager::ProjectManager() { tabs = memnew(TabContainer); center_box->add_child(tabs); tabs->set_anchors_and_offsets_preset(Control::PRESET_WIDE); - tabs->set_tab_alignment(TabContainer::ALIGNMENT_LEFT); + tabs->set_tab_alignment(TabBar::ALIGNMENT_LEFT); tabs->connect("tab_changed", callable_mp(this, &ProjectManager::_on_tab_changed)); HBoxContainer *projects_hb = memnew(HBoxContainer); |