Fix the bit test for ABS_MT_SLOT to detect protocol B
authorShawn Rutledge <shawn.rutledge@nokia.com>
Tue, 6 Mar 2012 15:29:50 +0000 (16:29 +0100)
committerQt by Nokia <qt-info@nokia.com>
Tue, 6 Mar 2012 23:08:35 +0000 (00:08 +0100)
I tested, it didn't work.  This is from a previous patch I had
already gotten working before 40a5ba4d3fccb449dcfd8d9a0deaf4c7f0fe12bc
was submitted.

Change-Id: I868f069fe834b3122ed9b5b3dc9af0781d6e1d0d
Reviewed-by: Laszlo Agocs <laszlo.p.agocs@nokia.com>
src/plugins/generic/evdevtouch/qevdevtouch.cpp

index 73f253a..9e63474 100644 (file)
@@ -134,7 +134,7 @@ void QTouchScreenData::registerDevice()
 
 static inline bool testBit(long bit, const long *array)
 {
-    return array[bit / LONG_BITS] & (1 << (bit & (LONG_BITS - 1)));
+    return (array[bit / LONG_BITS] >> bit % LONG_BITS) & 1;
 }
 
 QTouchScreenHandler::QTouchScreenHandler(const QString &spec)