From f23663bb594c26c3ee7dfbd2f6f2fcc071744668 Mon Sep 17 00:00:00 2001 From: Priyansh Rathi Date: Fri, 4 Mar 2022 23:48:40 +0530 Subject: [PATCH] fix same project opening mutliple times from project manager --- editor/project_manager.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/editor/project_manager.cpp b/editor/project_manager.cpp index d464697b206..a48a54ea919 100644 --- a/editor/project_manager.cpp +++ b/editor/project_manager.cpp @@ -1020,6 +1020,8 @@ public: } }; + bool project_opening_initiated; + ProjectList(); ~ProjectList(); @@ -1097,6 +1099,7 @@ ProjectList::ProjectList() { add_child(_scroll_children); _icon_load_index = 0; + project_opening_initiated = false; } ProjectList::~ProjectList() { @@ -1705,7 +1708,9 @@ void ProjectList::_panel_input(const Ref &p_ev, Node *p_hb) { emit_signal(SIGNAL_SELECTION_CHANGED); - if (!mb->get_control() && mb->is_doubleclick()) { + // 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->get_control() && mb->is_doubleclick() && !project_opening_initiated) { emit_signal(SIGNAL_PROJECT_ASK_OPEN); } } @@ -2018,6 +2023,8 @@ void ProjectManager::_open_selected_projects() { ERR_FAIL_COND(err); } + _project_list->project_opening_initiated = true; + _dim_window(); get_tree()->quit(); }