Cocoa: Don’t send tablet events as mouse events
Re-apply change 6e850af09d
,
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>
This commit is contained in:
parent
b8a469af64
commit
d5e3dca8c5
@ -759,7 +759,10 @@ QT_WARNING_POP
|
|||||||
|
|
||||||
- (void)handleMouseEvent:(NSEvent *)theEvent
|
- (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 qtWindowPoint;
|
||||||
QPointF qtScreenPoint;
|
QPointF qtScreenPoint;
|
||||||
@ -788,8 +791,8 @@ QT_WARNING_POP
|
|||||||
nativeDrag->setLastMouseEvent(theEvent, self);
|
nativeDrag->setLastMouseEvent(theEvent, self);
|
||||||
|
|
||||||
Qt::KeyboardModifiers keyboardModifiers = [QNSView convertKeyModifiers:[theEvent modifierFlags]];
|
Qt::KeyboardModifiers keyboardModifiers = [QNSView convertKeyModifiers:[theEvent modifierFlags]];
|
||||||
QWindowSystemInterface::handleMouseEvent(targetView->m_window, timestamp, qtWindowPoint, qtScreenPoint, m_buttons, keyboardModifiers,
|
QWindowSystemInterface::handleMouseEvent(targetView->m_window, timestamp, qtWindowPoint, qtScreenPoint,
|
||||||
isTabletEvent ? Qt::MouseEventSynthesizedByQt : Qt::MouseEventNotSynthesized);
|
m_buttons, keyboardModifiers, Qt::MouseEventNotSynthesized);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)handleFrameStrutMouseEvent:(NSEvent *)theEvent
|
- (void)handleFrameStrutMouseEvent:(NSEvent *)theEvent
|
||||||
|
Loading…
Reference in New Issue
Block a user