Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. Bug Report: PySide6 Drag and Drop Functionality Broken with Cursor Showing Forbidden Symbol When Microsoft PowerToys FancyZones is Enabled
Forum Updated to NodeBB v4.3 + New Features

Bug Report: PySide6 Drag and Drop Functionality Broken with Cursor Showing Forbidden Symbol When Microsoft PowerToys FancyZones is Enabled

Scheduled Pinned Locked Moved Solved Qt for Python
qt for pythonpyside
4 Posts 3 Posters 153 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    know634
    wrote last edited by
    #1

    Bug Report: PySide6 Drag and Drop Functionality Broken with Cursor Showing Forbidden Symbol When Microsoft PowerToys FancyZones is Enabled

    Posted by: know634
    Date: September 19, 2025

    Hello Qt Community and Development Team,

    I'm reporting a compatibility issue between PySide6 (Qt for Python) and Microsoft PowerToys FancyZones that completely breaks drag-and-drop functionality in PySide6 apps on Windows.

    Problem Summary

    When FancyZones is enabled in PowerToys, drag-and-drop fails entirely in PySide6 applications. The cursor shows a forbidden symbol (🚫) during drags, and no drag events are processed.

    Environment Details

    • Operating System: Windows 11 Professional Edition
      • Version: 24H2
      • OS Build: 26100.6584
      • Installed: August 8, 2025
      • Experience: Windows Feature Experience Pack 1000.26100.234.0
    • Qt/PySide6 Version: 6.5.3 to 6.9.2 (all tested versions affected)
    • Microsoft PowerToys Version: 0.93.0 (FancyZones enabled)
    • Python Version: 3.13.5 (packaged by Anaconda, Inc.)

    Steps to Reproduce

    1. Install and enable Microsoft PowerToys with FancyZones active.
    2. Run a PySide6 app with drag-and-drop support (see example code below).
    3. Drag files from Windows Explorer into the app window.
    4. Observe the failure:
      • Cursor shows forbidden symbol (🚫) instead of copy/move cursor.
      • App does not respond to dragged content.
      • Drag event handlers (e.g., dragEnterEvent) are not triggered.

    Disabling FancyZones immediately restores normal functionality.

    Expected vs. Actual Behavior

    • Expected: Cursor changes to appropriate drop cursor (copy/move). App receives and processes drag events. Dropped files are handled.
    • Actual: Forbidden cursor (🚫). No drag events received (dragEnterEvent, dragMoveEvent, dropEvent). Drag-and-drop completely fails.

    Minimal Reproducible Example

    Here's a simple PySide6 app to test:

    import sys
    from PySide6.QtWidgets import QApplication, QMainWindow, QTextEdit, QVBoxLayout, QWidget
    from PySide6.QtCore import Qt
    
    class DragDropTestWindow(QMainWindow):
        def __init__(self):
            super().__init__()
            self.setWindowTitle("Drag and Drop Test")
            self.setMinimumSize(500, 400)
            
            central_widget = QWidget()
            self.setCentralWidget(central_widget)
            layout = QVBoxLayout(central_widget)
            
            self.text_edit = QTextEdit()
            self.text_edit.setPlaceholderText("Drag files here to test functionality...")
            self.text_edit.setAcceptDrops(False)
            layout.addWidget(self.text_edit)
            
            self.setAcceptDrops(True)
            self.statusBar().showMessage("Ready - Drag files over this window")
    
        def dragEnterEvent(self, event):
            if event.mimeData().hasUrls():
                event.setDropAction(Qt.CopyAction)
                event.accept()
                self.statusBar().showMessage("Drop file to process")
            else:
                event.ignore()
                self.statusBar().showMessage("Unsupported content - only files are accepted")
    
        def dragMoveEvent(self, event):
            if event.mimeData().hasUrls():
                event.setDropAction(Qt.CopyAction)
                event.accept()
            else:
                event.ignore()
    
        def dropEvent(self, event):
            if event.mimeData().hasUrls():
                event.setDropAction(Qt.CopyAction)
                event.accept()
                
                file_paths = []
                for url in event.mimeData().urls():
                    if url.isLocalFile():
                        file_path = url.toLocalFile()
                        file_paths.append(file_path)
                        print(f"File dropped: {file_path}")
                
                if file_paths:
                    self.text_edit.setText("\n".join(file_paths))
                    self.statusBar().showMessage(f"Processed {len(file_paths)} file(s)")
                else:
                    self.statusBar().showMessage("No valid files dropped")
            else:
                event.ignore()
                self.statusBar().showMessage("Drop ignored - invalid content")
    
    if __name__ == "__main__":
        app = QApplication(sys.argv)
        window = DragDropTestWindow()
        window.show()
        sys.exit(app.exec())
    

    Run this, enable FancyZones, and try dragging a file—it won't work.

    Root Cause (Suspected)

    This seems due to a conflict between FancyZones' system-level mouse hooks (for window snapping) and Qt's event loop. The hooks intercept events before Qt can handle drag-and-drop state.

    Impact

    • Breaks core UX in PySide6 apps relying on drag-and-drop (e.g., file loaders).
    • Affects many Windows users with PowerToys installed.
    • Undermines Qt's Windows reliability.

    Workarounds

    • Disable FancyZones entirely.
    • Exclude the PySide6 app from FancyZones (via PowerToys settings).

    Neither is great—disabling loses productivity features, and exclusions require per-app tweaks.

    Request for Help

    Could the Qt team investigate this? A fix for coexistence with tools like FancyZones would be awesome. I'm happy to test patches or provide more logs.

    Thanks for your time—looking forward to thoughts or solutions!

    Best,
    know634
    1589575776@qq.com

    1 Reply Last reply
    1
    • jeremy_kJ Offline
      jeremy_kJ Offline
      jeremy_k
      wrote last edited by
      #2

      The Qt bug tracker is at https://bugreports.qt.io. The probability of a bug report being seen by someone interested is significantly higher there.

      Asking a question about code? http://eel.is/iso-c++/testcase/

      1 Reply Last reply
      1
      • F Offline
        F Offline
        friedemannkleint
        wrote last edited by
        #3

        Also note, since this is unrelated to the Python bindings of Qt, it needs to be reported
        under QTBUG with a C++ example (see https://wiki.qt.io/Qt_for_Python/Reporting_Bugs , https://wiki.qt.io/Reporting_Bugs ).

        1 Reply Last reply
        0
        • K Offline
          K Offline
          know634
          wrote last edited by
          #4

          Update on the Drag-and-Drop Issue: Root Cause Identified

          I've identified the bug: The issue is caused by running the application as Administrator, not by having Microsoft PowerToys FancyZones enabled.

          Thank you to everyone who provided feedback on this issue. After further investigation, I've determined that the primary cause of the drag-and-drop failure is running the PySide6 application with administrator privileges, not the presence of Microsoft PowerToys FancyZones.

          Root Cause Clarification

          Windows implements strict security isolation between processes running at different privilege levels. When a PySide6 application runs with administrator rights, it operates in a different security context than most desktop applications (including Windows Explorer, which typically runs at standard user level). This isolation prevents the cross-process communication necessary for drag-and-drop operations to function properly, resulting in the forbidden symbol (🚫).

          Recommended Solution

          1. Run your PySide6 application at standard user privilege level (without administrator rights). This is the most straightforward solution and maintains normal drag-and-drop functionality.
          2. If your application genuinely requires elevated privileges for certain operations, consider:
            • Implementing alternative file selection methods in your UI (e.g., QFileDialog for file opens, command-line argument support, or copy/paste path handling).
            • Restructuring your application so that only the specific components needing elevated privileges run as administrator, while the main GUI runs at standard user level.

          Why FancyZones Might Have Seemed Related

          PowerToys FancyZones, which manages window layouts, might have interacted visibly with the window of an elevated application, potentially making the issue more noticeable. However, the core permission isolation issue lies with the administrator privilege level itself.

          Verification

          You can verify this by running the provided example code without administrator privileges. Drag-and-drop should function correctly, even with FancyZones enabled.

          Apologies for the initial confusion regarding FancyZones, and I hope this clarification helps others experiencing similar issues.

          1 Reply Last reply
          1
          • K know634 has marked this topic as solved

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved