diff options
author | Liang Qi <liang.qi@theqtcompany.com> | 2015-11-18 09:01:51 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@theqtcompany.com> | 2015-11-18 09:01:51 +0100 |
commit | c7934f2489e2eb9a539206bab35f335b1943c5bd (patch) | |
tree | a27d0ed6c001fe9432e2a0f28fb935acf9e4c65f /src/plugins/platforms/cocoa | |
parent | f40593b11199fbef886bfcb6b210a214d8c3adf3 (diff) | |
parent | 08f9a1bd6ab9b1777ee5ba163d75e5c848c39eb4 (diff) |
Merge remote-tracking branch 'origin/5.6' into dev
Conflicts:
src/corelib/io/qprocess.cpp
src/corelib/io/qprocess_unix.cpp
src/network/kernel/qnetworkinterface_winrt.cpp
tools/configure/configureapp.cpp
Change-Id: I47df00a01597d2e63b334b492b3b4221b29f58ea
Diffstat (limited to 'src/plugins/platforms/cocoa')
-rw-r--r-- | src/plugins/platforms/cocoa/qnsview.h | 1 | ||||
-rw-r--r-- | src/plugins/platforms/cocoa/qnsview.mm | 16 |
2 files changed, 14 insertions, 3 deletions
diff --git a/src/plugins/platforms/cocoa/qnsview.h b/src/plugins/platforms/cocoa/qnsview.h index be7602a815..e754855e7f 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..f414193bdb 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) { @@ -1464,8 +1465,10 @@ static QTabletEvent::TabletDevice wacomTabletDevice(NSEvent *theEvent) // Popups implicitly grab key events; forward to the active popup if there is one. // This allows popups to e.g. intercept shortcuts and close the popup in response. - if (QCocoaWindow *popup = QCocoaIntegration::instance()->activePopupWindow()) - window = popup->window(); + if (QCocoaWindow *popup = QCocoaIntegration::instance()->activePopupWindow()) { + if (!popup->m_windowFlags.testFlag(Qt::ToolTip)) + window = popup->window(); + } if (eventType == QEvent::KeyPress) { @@ -1917,6 +1920,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 +1940,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 |