diff options
author | Shawn Rutledge <shawn.rutledge@theqtcompany.com> | 2016-04-08 13:39:12 +0200 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@theqtcompany.com> | 2016-04-25 05:22:42 +0000 |
commit | 6e850af09dd595b3b0e87135a1e68755c35f8964 (patch) | |
tree | 4d48a3c040bdebc65801141b117f67c148725c12 /src/plugins/platforms/cocoa/qnsview.mm | |
parent | 83b2c97713211cca8f77c169adc1442edf963de3 (diff) |
OSX: remove tablet->mouse event synth
The synthesis of mouse events for unhandled tablet events is now in
cross-platform code, so the platform plugins don't need to do it.
Task-number: QTBUG-47007
Change-Id: I948be398e4b1ab627a8dc97ca20c08dba4390238
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Diffstat (limited to 'src/plugins/platforms/cocoa/qnsview.mm')
-rw-r--r-- | src/plugins/platforms/cocoa/qnsview.mm | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm index 12629700ec..dc6e419e13 100644 --- a/src/plugins/platforms/cocoa/qnsview.mm +++ b/src/plugins/platforms/cocoa/qnsview.mm @@ -746,7 +746,8 @@ QT_WARNING_POP - (void)handleMouseEvent:(NSEvent *)theEvent { - [self handleTabletEvent: theEvent]; + if ([self handleTabletEvent: theEvent]) + return; QPointF qtWindowPoint; QPointF qtScreenPoint; @@ -1152,11 +1153,11 @@ struct QCocoaTabletDeviceData typedef QHash<uint, QCocoaTabletDeviceData> QCocoaTabletDeviceDataHash; Q_GLOBAL_STATIC(QCocoaTabletDeviceDataHash, tabletDeviceDataHash) -- (void)handleTabletEvent: (NSEvent *)theEvent +- (bool)handleTabletEvent: (NSEvent *)theEvent { NSEventType eventType = [theEvent type]; if (eventType != NSTabletPoint && [theEvent subtype] != NSTabletPointEventSubtype) - return; // Not a tablet event. + return false; // Not a tablet event. ulong timestamp = [theEvent timestamp] * 1000; @@ -1169,7 +1170,7 @@ Q_GLOBAL_STATIC(QCocoaTabletDeviceDataHash, tabletDeviceDataHash) // Error: Unknown tablet device. Qt also gets into this state // when running on a VM. This appears to be harmless; don't // print a warning. - return; + return false; } const QCocoaTabletDeviceData &deviceData = tabletDeviceDataHash->value(deviceId); @@ -1210,6 +1211,7 @@ Q_GLOBAL_STATIC(QCocoaTabletDeviceDataHash, tabletDeviceDataHash) deviceData.device, deviceData.pointerType, buttons, pressure, xTilt, yTilt, tangentialPressure, rotation, z, deviceData.uid, keyboardModifiers); + return true; } - (void)tabletPoint: (NSEvent *)theEvent |