diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp index afb3ac7c155..99a1cffa30e 100644 --- a/editor/scene_tree_dock.cpp +++ b/editor/scene_tree_dock.cpp @@ -59,10 +59,7 @@ #endif // MODULE_REGEX_ENABLED void SceneTreeDock::_nodes_drag_begin() { - if (restore_script_editor_on_drag) { - EditorNode::get_singleton()->set_visible_editor(EditorNode::EDITOR_SCRIPT); - restore_script_editor_on_drag = false; - } + pending_click_select = nullptr; } void SceneTreeDock::_quick_open() { @@ -74,8 +71,9 @@ void SceneTreeDock::input(const Ref &p_event) { Ref mb = p_event; - if (mb.is_valid() && !mb->is_pressed() && mb->get_button_index() == MouseButton::LEFT) { - restore_script_editor_on_drag = false; //lost chance + if (pending_click_select && mb.is_valid() && !mb->is_pressed() && (mb->get_button_index() == MouseButton::LEFT || mb->get_button_index() == MouseButton::RIGHT)) { + _push_item(pending_click_select); + pending_click_select = nullptr; } } @@ -1369,8 +1367,14 @@ void SceneTreeDock::_script_open_request(const Ref