diff options
Diffstat (limited to 'src/plugins/platforms/cocoa/qnsview.mm')
-rw-r--r-- | src/plugins/platforms/cocoa/qnsview.mm | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm index 90d56bc3f3..47081ab890 100644 --- a/src/plugins/platforms/cocoa/qnsview.mm +++ b/src/plugins/platforms/cocoa/qnsview.mm @@ -562,9 +562,11 @@ static QTouchDevice *touchDevice = 0; QPointF qtWindowPoint; QPointF qtScreenPoint; QNSView *targetView = self; - if (m_platformWindow && m_platformWindow->m_forwardWindow - && (theEvent.type == NSLeftMouseDragged || theEvent.type == NSLeftMouseUp)) { - targetView = m_platformWindow->m_forwardWindow->m_qtView; + if (m_platformWindow && m_platformWindow->m_forwardWindow) { + if (theEvent.type == NSLeftMouseDragged || theEvent.type == NSLeftMouseUp) + targetView = m_platformWindow->m_forwardWindow->m_qtView; + else + m_platformWindow->m_forwardWindow = 0; } [targetView convertFromScreen:[NSEvent mouseLocation] toWindowPoint:&qtWindowPoint andScreenPoint:&qtScreenPoint]; @@ -650,7 +652,7 @@ static QTouchDevice *touchDevice = 0; { if (m_window->flags() & Qt::WindowTransparentForInput) return [super mouseDragged:theEvent]; - if (!(m_buttons & Qt::LeftButton)) + if (!(m_buttons & (m_sendUpAsRightButton ? Qt::RightButton : Qt::LeftButton))) qWarning("QNSView mouseDragged: Internal mouse button tracking invalid (missing Qt::LeftButton)"); [self handleMouseEvent:theEvent]; } @@ -1719,7 +1721,7 @@ static QTabletEvent::TabletDevice wacomTabletDevice(NSEvent *theEvent) // keep our state, and QGuiApplication state (buttons member) in-sync, // or future mouse events will be processed incorrectly - m_buttons &= ~Qt::LeftButton; + m_buttons &= ~(m_sendUpAsRightButton ? Qt::RightButton : Qt::LeftButton); NSPoint windowPoint = [self convertPoint: point fromView: nil]; QPoint qtWindowPoint(windowPoint.x, windowPoint.y); |