Cocoa: Follow-up m_sendUpAsRightButton for DnD

Clear and test for the correct button according to
the m_sendUpAsRightButton flag.

(Fixes the warning mentioned QTBUG-35804)

Task-number: QTBUG-35804
Change-Id: I5d724d1cfa66b88b8f54e228bd7fb73a04a9f4c9
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
This commit is contained in:
Morten Johan Sørvig 2014-03-19 13:26:52 +01:00 committed by The Qt Project
parent 91d0ba8ff4
commit a791943490

View File

@ -652,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];
}
@ -1721,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);