fix same project opening mutliple times from project manager

This commit is contained in:
Priyansh Rathi 2022-03-04 23:48:40 +05:30
parent d8e460cd57
commit f23663bb59
No known key found for this signature in database
GPG key ID: 8AB1FB727C1DBA82

View file

@ -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<InputEvent> &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();
}