debug: print drag-drop events to diagnose Wayland DnD

This commit is contained in:
2026-04-06 20:37:13 +02:00
parent c80ebf9383
commit f30955b63c
+7
View File
@@ -1257,18 +1257,25 @@ class MainWindow(QMainWindow):
# --- Mask generation --- # --- Mask generation ---
def dragEnterEvent(self, event: QDragEnterEvent) -> None: def dragEnterEvent(self, event: QDragEnterEvent) -> None:
print("dragEnter formats:", event.mimeData().formats(), flush=True)
if event.mimeData().hasUrls(): if event.mimeData().hasUrls():
event.acceptProposedAction() event.acceptProposedAction()
else:
event.ignore()
def dragMoveEvent(self, event) -> None: def dragMoveEvent(self, event) -> None:
if event.mimeData().hasUrls(): if event.mimeData().hasUrls():
event.acceptProposedAction() event.acceptProposedAction()
else:
event.ignore()
def dropEvent(self, event: QDropEvent) -> None: def dropEvent(self, event: QDropEvent) -> None:
print("drop urls:", event.mimeData().urls(), flush=True)
paths = [ paths = [
u.toLocalFile() for u in event.mimeData().urls() u.toLocalFile() for u in event.mimeData().urls()
if os.path.isfile(u.toLocalFile()) if os.path.isfile(u.toLocalFile())
] ]
print("drop paths:", paths, flush=True)
if paths: if paths:
self._playlist.add_files(paths) self._playlist.add_files(paths)