fix same project opening mutliple times from project manager
This commit is contained in:
parent
d8e460cd57
commit
f23663bb59
1 changed files with 8 additions and 1 deletions
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue