summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/plugins/platforms/cocoa/qnsview.h1
-rw-r--r--src/plugins/platforms/cocoa/qnsview.mm10
2 files changed, 10 insertions, 1 deletions
diff --git a/src/plugins/platforms/cocoa/qnsview.h b/src/plugins/platforms/cocoa/qnsview.h
index de28b8d74a..bad67f2516 100644
--- a/src/plugins/platforms/cocoa/qnsview.h
+++ b/src/plugins/platforms/cocoa/qnsview.h
@@ -75,6 +75,7 @@ Q_FORWARD_DECLARE_OBJC_CLASS(QT_MANGLE_NAMESPACE(QNSViewMouseMoveHelper));
QT_MANGLE_NAMESPACE(QNSViewMouseMoveHelper) *m_mouseMoveHelper;
bool m_resendKeyEvent;
bool m_scrolling;
+ bool m_updatingDrag;
bool m_exposedOnMoveToWindow;
NSEvent *m_currentlyInterpretedKeyEvent;
bool m_isMenuView;
diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm
index faa048874f..aac50e7833 100644
--- a/src/plugins/platforms/cocoa/qnsview.mm
+++ b/src/plugins/platforms/cocoa/qnsview.mm
@@ -153,6 +153,7 @@ static NSString *_q_NSWindowDidChangeOcclusionStateNotification = nil;
m_mouseMoveHelper = [[QT_MANGLE_NAMESPACE(QNSViewMouseMoveHelper) alloc] initWithView:self];
m_resendKeyEvent = false;
m_scrolling = false;
+ m_updatingDrag = false;
m_currentlyInterpretedKeyEvent = 0;
if (!touchDevice) {
@@ -1917,6 +1918,9 @@ static QPoint mapWindowCoordinates(QWindow *source, QWindow *target, QPoint poin
// Make sure the cursor is updated correctly if the mouse does not move and window is under cursor
// by creating a fake move event
+ if (m_updatingDrag)
+ return;
+
const QPoint mousePos(QCursor::pos());
CGEventRef moveEvent(CGEventCreateMouseEvent(
NULL, kCGEventMouseMoved,
@@ -1934,7 +1938,11 @@ static QPoint mapWindowCoordinates(QWindow *source, QWindow *target, QPoint poin
- (NSDragOperation)draggingUpdated:(id <NSDraggingInfo>)sender
{
- return [self handleDrag : sender];
+ m_updatingDrag = true;
+ const NSDragOperation ret([self handleDrag : sender]);
+ m_updatingDrag = false;
+
+ return ret;
}
// Sends drag update to Qt, return the action