From 32967b052adff8c59f41160088a6acecb5a81813 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Fri, 7 Jun 2013 09:48:56 +0200 Subject: Cleanup the QDrag when doing a drag with the right mouse button on Mac When doing a drag with the right mouse button on Mac then it will be ignored straightaway because it will not be accepted. Therefore we need to cleanup the QDrag object as normal so that it is deleted as appropriate. Change-Id: I781fcea7b7c75775adb814090e917363fa7c9189 Reviewed-by: Richard Moe Gustavsen --- src/gui/kernel/qcocoaview_mac.mm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/gui/kernel/qcocoaview_mac.mm b/src/gui/kernel/qcocoaview_mac.mm index e3f0f98..16247b5 100644 --- a/src/gui/kernel/qcocoaview_mac.mm +++ b/src/gui/kernel/qcocoaview_mac.mm @@ -1284,8 +1284,11 @@ Qt::DropAction QDragManager::drag(QDrag *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)) + if (!(GetCurrentEventButtonState() & kEventMouseButtonPrimary)) { + o->setMimeData(0); + o->deleteLater(); return Qt::IgnoreAction; + } if(object) { dragPrivate()->source->removeEventFilter(this); -- cgit v0.12