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>
This commit is contained in:
parent
83b2c97713
commit
6e850af09d
@ -341,6 +341,7 @@ QCocoaIntegration::QCocoaIntegration(const QStringList ¶mList)
|
|||||||
|
|
||||||
QMacInternalPasteboardMime::initializeMimeTypes();
|
QMacInternalPasteboardMime::initializeMimeTypes();
|
||||||
QCocoaMimeTypes::initializeMimeTypes();
|
QCocoaMimeTypes::initializeMimeTypes();
|
||||||
|
QWindowSystemInterfacePrivate::TabletEvent::setPlatformSynthesizesMouse(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
QCocoaIntegration::~QCocoaIntegration()
|
QCocoaIntegration::~QCocoaIntegration()
|
||||||
|
@ -140,7 +140,7 @@ Q_FORWARD_DECLARE_OBJC_CLASS(QT_MANGLE_NAMESPACE(QNSViewMouseMoveHelper));
|
|||||||
- (void)otherMouseUp:(NSEvent *)theEvent;
|
- (void)otherMouseUp:(NSEvent *)theEvent;
|
||||||
- (void)handleFrameStrutMouseEvent:(NSEvent *)theEvent;
|
- (void)handleFrameStrutMouseEvent:(NSEvent *)theEvent;
|
||||||
|
|
||||||
- (void)handleTabletEvent: (NSEvent *)theEvent;
|
- (bool)handleTabletEvent: (NSEvent *)theEvent;
|
||||||
- (void)tabletPoint: (NSEvent *)theEvent;
|
- (void)tabletPoint: (NSEvent *)theEvent;
|
||||||
- (void)tabletProximity: (NSEvent *)theEvent;
|
- (void)tabletProximity: (NSEvent *)theEvent;
|
||||||
|
|
||||||
|
@ -746,7 +746,8 @@ QT_WARNING_POP
|
|||||||
|
|
||||||
- (void)handleMouseEvent:(NSEvent *)theEvent
|
- (void)handleMouseEvent:(NSEvent *)theEvent
|
||||||
{
|
{
|
||||||
[self handleTabletEvent: theEvent];
|
if ([self handleTabletEvent: theEvent])
|
||||||
|
return;
|
||||||
|
|
||||||
QPointF qtWindowPoint;
|
QPointF qtWindowPoint;
|
||||||
QPointF qtScreenPoint;
|
QPointF qtScreenPoint;
|
||||||
@ -1152,11 +1153,11 @@ struct QCocoaTabletDeviceData
|
|||||||
typedef QHash<uint, QCocoaTabletDeviceData> QCocoaTabletDeviceDataHash;
|
typedef QHash<uint, QCocoaTabletDeviceData> QCocoaTabletDeviceDataHash;
|
||||||
Q_GLOBAL_STATIC(QCocoaTabletDeviceDataHash, tabletDeviceDataHash)
|
Q_GLOBAL_STATIC(QCocoaTabletDeviceDataHash, tabletDeviceDataHash)
|
||||||
|
|
||||||
- (void)handleTabletEvent: (NSEvent *)theEvent
|
- (bool)handleTabletEvent: (NSEvent *)theEvent
|
||||||
{
|
{
|
||||||
NSEventType eventType = [theEvent type];
|
NSEventType eventType = [theEvent type];
|
||||||
if (eventType != NSTabletPoint && [theEvent subtype] != NSTabletPointEventSubtype)
|
if (eventType != NSTabletPoint && [theEvent subtype] != NSTabletPointEventSubtype)
|
||||||
return; // Not a tablet event.
|
return false; // Not a tablet event.
|
||||||
|
|
||||||
ulong timestamp = [theEvent timestamp] * 1000;
|
ulong timestamp = [theEvent timestamp] * 1000;
|
||||||
|
|
||||||
@ -1169,7 +1170,7 @@ Q_GLOBAL_STATIC(QCocoaTabletDeviceDataHash, tabletDeviceDataHash)
|
|||||||
// Error: Unknown tablet device. Qt also gets into this state
|
// Error: Unknown tablet device. Qt also gets into this state
|
||||||
// when running on a VM. This appears to be harmless; don't
|
// when running on a VM. This appears to be harmless; don't
|
||||||
// print a warning.
|
// print a warning.
|
||||||
return;
|
return false;
|
||||||
}
|
}
|
||||||
const QCocoaTabletDeviceData &deviceData = tabletDeviceDataHash->value(deviceId);
|
const QCocoaTabletDeviceData &deviceData = tabletDeviceDataHash->value(deviceId);
|
||||||
|
|
||||||
@ -1210,6 +1211,7 @@ Q_GLOBAL_STATIC(QCocoaTabletDeviceDataHash, tabletDeviceDataHash)
|
|||||||
deviceData.device, deviceData.pointerType, buttons, pressure, xTilt, yTilt,
|
deviceData.device, deviceData.pointerType, buttons, pressure, xTilt, yTilt,
|
||||||
tangentialPressure, rotation, z, deviceData.uid,
|
tangentialPressure, rotation, z, deviceData.uid,
|
||||||
keyboardModifiers);
|
keyboardModifiers);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)tabletPoint: (NSEvent *)theEvent
|
- (void)tabletPoint: (NSEvent *)theEvent
|
||||||
|
Loading…
x
Reference in New Issue
Block a user