summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorPriyansh Rathi <techiepriyansh@gmail.com>2022-03-04 23:48:40 +0530
committerPriyansh Rathi <techiepriyansh@gmail.com>2022-03-06 18:24:06 +0530
commitd5b8a251953d62fdb4508d4cda47265ec1f44856 (patch)
tree48dc6d7d0f0d07f0592142927e68da13b8314b85 /editor
parentf356c8ac4bfb16be361d8ff21ecbb406baa6e631 (diff)
fix same project opening mutliple times from project manager
Diffstat (limited to 'editor')
-rw-r--r--editor/project_manager.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/editor/project_manager.cpp b/editor/project_manager.cpp
index 79aed36eeb..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();
}