diff --git a/recaf-ui/src/main/java/software/coley/recaf/ui/dnd/WorkspaceLoadingDropListener.java b/recaf-ui/src/main/java/software/coley/recaf/ui/dnd/WorkspaceLoadingDropListener.java index 38fbfd42e..f200b8e7d 100644 --- a/recaf-ui/src/main/java/software/coley/recaf/ui/dnd/WorkspaceLoadingDropListener.java +++ b/recaf-ui/src/main/java/software/coley/recaf/ui/dnd/WorkspaceLoadingDropListener.java @@ -48,7 +48,8 @@ public void onDragDrop(@Nonnull Region region, @Nonnull DragEvent event, @Nonnul if (config.createOnDragDrop()) { // Create new workspace from files - Path primary = files.get(0); + // - The last path is actually the first file selected by the user when multiple files are selected + Path primary = files.getLast(); List supporting = files.size() > 1 ? files.subList(1, files.size()) : Collections.emptyList(); pathLoadingManager.asyncNewWorkspace(primary, supporting, err -> { logger.error("Failed to create new workspace from dropped files", err);