summaryrefslogtreecommitdiff
path: root/packages/qte/qte-2.3.10/tslib.patch
diff options
context:
space:
mode:
authorHolger Freyther <zecke@selfish.org>2005-02-16 01:18:52 +0000
committerHolger Freyther <zecke@selfish.org>2005-02-16 01:18:52 +0000
commitfc79920dd48b5127d9e61366d19cb607958ad57e (patch)
tree73af9fd38a8d6b37984c5eb1ae0b67287db26b11 /packages/qte/qte-2.3.10/tslib.patch
parent0c04f1a530d2f2a34ca5944311589baf86dc9d4e (diff)
Qt 2.3.10:
Mess with the collection of samples and stay in the bounds + wrap around (tested on ipaq) BKrev: 42129f7cbLVr62mjl9CJO5Bk6ZTrlA
Diffstat (limited to 'packages/qte/qte-2.3.10/tslib.patch')
-rw-r--r--packages/qte/qte-2.3.10/tslib.patch53
1 files changed, 53 insertions, 0 deletions
diff --git a/packages/qte/qte-2.3.10/tslib.patch b/packages/qte/qte-2.3.10/tslib.patch
index e69de29bb2..47837d7a5d 100644
--- a/packages/qte/qte-2.3.10/tslib.patch
+++ b/packages/qte/qte-2.3.10/tslib.patch
@@ -0,0 +1,53 @@
+Index: qt-2.3.10/src/kernel/qwsmouse_qws.cpp
+===================================================================
+--- qt-2.3.10.orig/src/kernel/qwsmouse_qws.cpp 2005-02-16 00:53:53.090339898 +0100
++++ qt-2.3.10/src/kernel/qwsmouse_qws.cpp 2005-02-16 00:54:43.059069292 +0100
+@@ -1878,30 +1878,33 @@
+ */
+ void QTSLibHandlerPrivate::interpolateSample() {
+ #ifdef QT_QWS_TSLIB
+- static struct ts_sample samples[25];
+- int index = -1;
++#define TSLIB_MAX_SAMPLES 25
++ static struct ts_sample samples[TSLIB_MAX_SAMPLES];
++ int index = 0;
++ int read_samples = 0;
+ int ret;
+
+ do {
+- /* fill only the last sample again */
+- if ( index >= 25 )
+- index = 24;
+-
++ /* do not access negative arrays */
++ if ( index < 0 )
++ index = 0;
++
+ /* we're opened non-blocking */
+- if((ret= ts_read_raw(m_ts, &samples[index], 1 ) ) != 1 ) {
++ if((ret= ts_read_raw(m_ts, &samples[index], 1 ) ) != 1 )
+ /* no event yet, so try again */
+- if (ret==-1 ) {
+- index--;
++ if (ret==-1 )
+ continue;
+- }
+- }
+- }while (samples[index++].pressure != 0);
++
++ read_samples++;
++ index = (index+1)%TSLIB_MAX_SAMPLES;
++ }while (samples[index == 0 ? (TSLIB_MAX_SAMPLES-1) : index-1].pressure != 0);
+
+ /*
+- * index is maximal 25 and we at least one sample
++ * If we've wrapped around each sample is used otherwise
++ * we will use the index
+ */
+- if( index >= 25 )
+- index = 24;
++ index = read_samples >= TSLIB_MAX_SAMPLES ?
++ (TSLIB_MAX_SAMPLES-1 ) : index;
+ int x, y;
+
+ /*