summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms
diff options
context:
space:
mode:
authorMorten Johan Sørvig <morten.sorvig@qt.io>2016-09-29 12:16:11 +0200
committerMorten Johan Sørvig <morten.sorvig@qt.io>2016-10-03 10:18:49 +0000
commitd5e3dca8c56f60e0da5d707dbbe0c424b75c947a (patch)
tree22babf683e93ed4c3a2d53210328c83ee9f8d75f /src/plugins/platforms
parentb8a469af64bf321e3a463b05820034945c35ee2c (diff)
Cocoa: Don’t send tablet events as mouse events
Re-apply change 6e850af09dd595b3b0e87135a1e68755c35f8964, the code for which has gone missing. This prevents sending tablet events as both mouse and tablet events, which confuses the double-click detection code in QGuiApplication::processMouseEvent() when tablet->mouse event synthesis is enabled. Task-number: QTBUG-54399 Task-number: QTBUG-51617 Task-number: QTBUG-47007 Change-Id: I6183906d4ce2b8cdc617d34e22a9dcf999eef51d Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/plugins/platforms')
-rw-r--r--src/plugins/platforms/cocoa/qnsview.mm9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm
index d29272a88f..51a69be759 100644
--- a/src/plugins/platforms/cocoa/qnsview.mm
+++ b/src/plugins/platforms/cocoa/qnsview.mm
@@ -759,7 +759,10 @@ QT_WARNING_POP
- (void)handleMouseEvent:(NSEvent *)theEvent
{
- bool isTabletEvent = [self handleTabletEvent: theEvent];
+ // Tablet events may come in via the mouse event handlers,
+ // check if this is a valid tablet event first.
+ if ([self handleTabletEvent: theEvent])
+ return;
QPointF qtWindowPoint;
QPointF qtScreenPoint;
@@ -788,8 +791,8 @@ QT_WARNING_POP
nativeDrag->setLastMouseEvent(theEvent, self);
Qt::KeyboardModifiers keyboardModifiers = [QNSView convertKeyModifiers:[theEvent modifierFlags]];
- QWindowSystemInterface::handleMouseEvent(targetView->m_window, timestamp, qtWindowPoint, qtScreenPoint, m_buttons, keyboardModifiers,
- isTabletEvent ? Qt::MouseEventSynthesizedByQt : Qt::MouseEventNotSynthesized);
+ QWindowSystemInterface::handleMouseEvent(targetView->m_window, timestamp, qtWindowPoint, qtScreenPoint,
+ m_buttons, keyboardModifiers, Qt::MouseEventNotSynthesized);
}
- (void)handleFrameStrutMouseEvent:(NSEvent *)theEvent