Cocoa platform plugin: Reduce multitouch area to be one pixel.

Mac only support multitouch points, hence width/height 1. Also add
comment about performance related to multitouch events.

Change-Id: I307261492366e361e17f9edf446f456c07c87a22
Reviewed-on: http://codereview.qt-project.org/5162
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Bjørn Erik Nilsen <bjorn.nilsen@nokia.com>
This commit is contained in:
Bjørn Erik Nilsen 2011-09-19 18:47:20 +02:00 committed by Qt by Nokia
parent 4a34b671f8
commit 3803111692
2 changed files with 5 additions and 2 deletions

View File

@ -90,7 +90,9 @@ QCocoaWindow::QCocoaWindow(QWindow *tlw)
m_contentView = [[QNSView alloc] initWithQWindow:tlw];
// Accept touch events by default.
// ### Accept touch events by default.
// Beware that enabling touch events has a negative impact on the overall performance.
// We probably need a QWindowSystemInterface API to enable/disable touch events.
[m_contentView setAcceptsTouchEvents:YES];
setGeometry(tlw->geometry());

View File

@ -91,7 +91,8 @@ void QCocoaTouch::updateTouchData(NSTouch *nstouch, NSTouchPhase phase)
float ppiX = (qnpos.x() - _trackpadReferencePos.x()) * dsize.width;
float ppiY = (qnpos.y() - _trackpadReferencePos.y()) * dsize.height;
QPointF relativePos = _trackpadReferencePos - QPointF(ppiX, ppiY);
_touchPoint.area = QRectF(_screenReferencePos - relativePos, QSize(dsize.width, dsize.height));
// Mac does not support area touch, only points, hence set width/height to 1.
_touchPoint.area = QRectF(_screenReferencePos - relativePos, QSize(1, 1));
}
QCocoaTouch *QCocoaTouch::findQCocoaTouch(NSTouch *nstouch)