Skip to content

Conversation

@zooba
Copy link
Member

@zooba zooba commented Nov 12, 2025

Fixes #217

@zooba
Copy link
Member Author

zooba commented Nov 12, 2025

Only a draft right now, because it doesn't load properly when installed via a test MSI (works fine if I hack in the registration). I need to do more testing, but can't do it right now.

Isn't going to work at all for the MSIX, so this will also need a troublshooting entry over on the docs.

@zooba zooba marked this pull request as ready for review November 12, 2025 23:16
@zooba
Copy link
Member Author

zooba commented Nov 12, 2025

It works fine on a clean machine, so let's take it.

@zooba zooba requested a review from Copilot November 13, 2025 19:37
Copilot finished reviewing on behalf of zooba November 13, 2025 19:42
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds drag-and-drop support for Python files by implementing a new COM drop handler (DragDropSupport class) and registering it in both MSI and MSIX/AppX packages. When files are dragged onto a Python script, the drop handler will execute the script with the dropped files as arguments.

Key Changes:

  • Implemented DragDropSupport COM class with IDropTarget and IPersistFile interfaces
  • Added drop handler registration in MSI for .py and .pyw file types
  • Added context menu registration for .pyw files in AppX manifest
  • Added test coverage for argument parsing and drop description functionality

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
src/pyshellext/shellext.cpp Implements DragDropSupport COM class for handling drag-and-drop operations, including argument parsing from dropped files and execution logic
src/pyshellext/shellext.h Adds function declarations for new drop-related helper functions
src/pyshellext/shellext_test.cpp Adds Python test wrapper functions for the new drop argument parsing and description functions
tests/test_shellext.py Adds unit tests for argument parsing (wide and ASCII) and drop description extraction
src/pymanager/msi.wxs Registers the DragDropSupport COM class and associates it as a drop handler for Python.File and Python.NoConFile ProgIds
src/pymanager/appxmanifest.xml Adds context menu verb registration for .pyw files using the EditInIdle command
_msbuild.py Adds pathcch.lib dependency required for path manipulation in the drop handler
_msbuild_test.py Adds pathcch.lib dependency and exports new test functions for the drop handler

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@zooba zooba merged commit 2cd04aa into python:main Nov 13, 2025
4 checks passed
@zooba zooba deleted the gh-217 branch November 13, 2025 21:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing DropHandler entries in registry, drag'n'drop does not work

1 participant