diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index f056a477c41..817f193ac01 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -5828,7 +5828,11 @@ PopupMenu *EditorNode::get_export_as_menu() { } void EditorNode::_dropped_files(const Vector &p_files) { - String to_path = ProjectSettings::get_singleton()->globalize_path(FileSystemDock::get_singleton()->get_current_directory()); + String to_path = FileSystemDock::get_singleton()->get_folder_path_at_mouse_position(); + if (to_path.is_empty()) { + to_path = FileSystemDock::get_singleton()->get_current_directory(); + } + to_path = ProjectSettings::get_singleton()->globalize_path(to_path); _add_dropped_files_recursive(p_files, to_path); diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp index c7e12d1f3b5..ce00ff2ba9b 100644 --- a/editor/filesystem_dock.cpp +++ b/editor/filesystem_dock.cpp @@ -2749,6 +2749,15 @@ void FileSystemDock::remove_resource_tooltip_plugin(const Refget_item_at_position(tree->get_local_mouse_position()); + if (!item) { + return String(); + } + String fpath = item->get_metadata(0); + return fpath.get_base_dir(); +} + Control *FileSystemDock::create_tooltip_for_path(const String &p_path) const { if (p_path == "Favorites") { // No tooltip for the "Favorites" group. diff --git a/editor/filesystem_dock.h b/editor/filesystem_dock.h index d2e403a8aff..2be99a084e8 100644 --- a/editor/filesystem_dock.h +++ b/editor/filesystem_dock.h @@ -380,6 +380,7 @@ public: String get_current_path() const; String get_current_directory() const; + String get_folder_path_at_mouse_position() const; void navigate_to_path(const String &p_path); void focus_on_path();