summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.p.agocs@nokia.com>2012-06-02 19:04:00 +0300
committerQt by Nokia <qt-info@nokia.com>2012-06-05 06:15:15 +0200
commit87e50e079ea226af95699438b38ee5f4574aae68 (patch)
treede34a47ed0ae0df38b87e71d95b69089e7bfcaa1 /src
parentf3f648f920a9f4676a5cde98806fc7735119984c (diff)
Make touch operating better on some touchpads
Some MT protocol capable touchpads do not provide ABS_MT_TOUCH_MAJOR. The calculation for touch area was meaningless in this case and resulted in a very small area not playing nice with apps like fingerpaint. Change-Id: Ibe472e22e5e792059fd594f54be9be8b75287730 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Diffstat (limited to 'src')
-rw-r--r--src/platformsupport/input/evdevtouch/qevdevtouch.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/platformsupport/input/evdevtouch/qevdevtouch.cpp b/src/platformsupport/input/evdevtouch/qevdevtouch.cpp
index 0f039a40d2..6bf9ba769e 100644
--- a/src/platformsupport/input/evdevtouch/qevdevtouch.cpp
+++ b/src/platformsupport/input/evdevtouch/qevdevtouch.cpp
@@ -82,7 +82,7 @@ public:
Qt::TouchPointState state;
QTouchEvent::TouchPoint::InfoFlags flags;
Contact() : trackingId(-1),
- x(0), y(0), maj(1), pressure(0),
+ x(0), y(0), maj(-1), pressure(0),
state(Qt::TouchPointPressed), flags(0) { }
};
QHash<int, Contact> m_contacts; // The key is a tracking id for type A, slot number for type B.
@@ -479,7 +479,10 @@ void QEvdevTouchScreenData::reportPoints()
const qreal wx = winRect.left() + tp.normalPosition.x() * winRect.width();
const qreal wy = winRect.top() + tp.normalPosition.y() * winRect.height();
const qreal sizeRatio = (winRect.width() + winRect.height()) / qreal(hw_w + hw_h);
- tp.area = QRectF(0, 0, tp.area.width() * sizeRatio, tp.area.height() * sizeRatio);
+ if (tp.area.width() == -1) // touch major was not provided
+ tp.area = QRectF(0, 0, 8, 8);
+ else
+ tp.area = QRectF(0, 0, tp.area.width() * sizeRatio, tp.area.height() * sizeRatio);
tp.area.moveCenter(QPointF(wx, wy));
// Calculate normalized pressure.