Details
-
Bug
-
Resolution: Invalid
-
P3: Somewhat important
-
4.5.0
-
None
Description
On Mac OS X, drag and drop operations do not work with the middle or the left button. The action is filtered to only work with the left button.
Some application use a different drag and drop depending on the button of the mouse.
Here is a patch to change this behavior:
diff --git a/src/gui/kernel/qcocoaview_mac.mm b/src/gui/kernel/qcocoaview_mac.mm index 722e3e2..9cbd501 100644 --- a/src/gui/kernel/qcocoaview_mac.mm +++ b/src/gui/kernel/qcocoaview_mac.mm @@ -1169,10 +1169,6 @@ Qt::DropAction QDragManager::drag(QDrag *o) } if(object == o) return Qt::IgnoreAction; - /* At the moment it seems clear that Mac OS X does not want to drag with a non-left button - so we just bail early to prevent it */ - if(!(GetCurrentEventButtonState() & kEventMouseButtonPrimary)) - return Qt::IgnoreAction; if(object) { dragPrivate()->source->removeEventFilter(this); diff --git a/src/gui/kernel/qdnd_mac.mm b/src/gui/kernel/qdnd_mac.mm index ec8005c..7477d2b 100644 --- a/src/gui/kernel/qdnd_mac.mm +++ b/src/gui/kernel/qdnd_mac.mm @@ -536,10 +536,6 @@ Qt::DropAction QDragManager::drag(QDrag *o) } if(object == o) return Qt::IgnoreAction; - /* At the moment it seems clear that Mac OS X does not want to drag with a non-left button - so we just bail early to prevent it */ - if(!(GetCurrentEventButtonState() & kEventMouseButtonPrimary)) - return Qt::IgnoreAction; if(object) { dragPrivate()->source->removeEventFilter(this);