Debian Bug report logs -
#501139
xserver-xorg-input-tslib: Does not handle button release events correctly
Reported by: Mikko Rasa <tdb@tdb.fi>
Date: Sat, 4 Oct 2008 16:18:01 UTC
Severity: normal
Tags: patch
Found in version xf86-input-tslib/0.0.5-1
Fixed in version xf86-input-tslib/0.0.5-3
Done: Wen-Yen Chuang <caleb@calno.com>
Bug is archived. No further changes may be made.
Toggle useless messages
Report forwarded
to debian-bugs-dist@lists.debian.org, Wen-Yen Chuang <caleb@calno.com>:
Bug#501139; Package xserver-xorg-input-tslib.
(Sat, 04 Oct 2008 16:18:04 GMT) (full text, mbox, link).
Acknowledgement sent
to Mikko Rasa <tdb@tdb.fi>:
New Bug report received and forwarded. Copy sent to Wen-Yen Chuang <caleb@calno.com>.
(Sat, 04 Oct 2008 16:18:04 GMT) (full text, mbox, link).
Message #5 received at submit@bugs.debian.org (full text, mbox, reply):
[Message part 1 (text/plain, inline)]
Package: xserver-xorg-input-tslib
Version: 0.0.5-1
Severity: normal
Tags: patch
When the variance module is enabled in ts.conf, the tslib input driver will
emit a ButtonRelease event only when the pen is pressed the next time. This
is because the variance module caches samples and will produce two samples on
a release event, but the input driver is only prepared to receive one sample
each time there is data available in the fd. A solution is to open the
touchscreen in non-blocking mode and read as long as samples are available.
-- System Information:
Debian Release: lenny/sid
APT prefers unstable
APT policy: (500, 'unstable'), (500, 'testing'), (1, 'experimental')
Architecture: i386 (i686)
Kernel: Linux 2.6.26.2 (SMP w/2 CPU cores)
Locale: LANG=en_US.utf8, LC_CTYPE=fi_FI.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
[tslib.patch (text/x-c, attachment)]
Information forwarded
to debian-bugs-dist@lists.debian.org, Wen-Yen Chuang <caleb@calno.com>:
Bug#501139; Package xserver-xorg-input-tslib.
(Sun, 05 Oct 2008 10:36:03 GMT) (full text, mbox, link).
Acknowledgement sent
to Mikko Rasa <tdb@tdb.fi>:
Extra info received and forwarded to list. Copy sent to Wen-Yen Chuang <caleb@calno.com>.
(Sun, 05 Oct 2008 10:36:03 GMT) (full text, mbox, link).
Message #10 received at 501139@bugs.debian.org (full text, mbox, reply):
[Message part 1 (text/plain, inline)]
It appears that I accidentally made a diff from the upstream version to
one that contained both Debian's and my patches. Attached is a
corrected version containing only my changes.
--
Mikko Rasa "The DataBeaver"
[tslib.patch (text/x-diff, inline)]
--- xf86-input-tslib-0.0.5/src/tslib.c 2008-10-05 13:28:02.000000000 +0300
+++ xf86-input-tslib-0.0.5.mod/src/tslib.c 2008-10-04 00:29:23.000000000 +0300
@@ -123,52 +123,50 @@
int ret;
int x,y;
- ret = ts_read(priv->ts, &samp, 1);
+ while((ret = ts_read(priv->ts, &samp, 1)) == 1) {
+ if(samp.pressure) {
+ int tmp_x = samp.x;
+
+ switch(priv->rotate) {
+ case TSLIB_ROTATE_CW: samp.x = samp.y;
+ samp.y = priv->width - tmp_x;
+ break;
+ case TSLIB_ROTATE_UD: samp.x = priv->width - samp.x;
+ samp.y = priv->height - samp.y;
+ break;
+ case TSLIB_ROTATE_CCW: samp.x = priv->height - samp.y;
+ samp.y = tmp_x;
+ break;
+ default: break;
+ }
+
+ priv->lastx = samp.x;
+ priv->lasty = samp.y;
+ x = samp.x;
+ y = samp.y;
+
+ xf86XInputSetScreen(local, priv->screen_num,
+ samp.x,
+ samp.y);
- if (ret < 0) {
- ErrorF("ts_read failed\n");
- return;
- }
+ xf86PostMotionEvent (local->dev, TRUE, 0, 2,
+ x, y);
-// ErrorF("%ld.%06ld: %6d %6d %6d\n", samp.tv.tv_sec, samp.tv.tv_usec, samp.x, samp.y, samp.pressure);
-
- if(samp.pressure) {
- int tmp_x = samp.x;
-
- switch(priv->rotate) {
- case TSLIB_ROTATE_CW: samp.x = samp.y;
- samp.y = priv->width - tmp_x;
- break;
- case TSLIB_ROTATE_UD: samp.x = priv->width - samp.x;
- samp.y = priv->height - samp.y;
- break;
- case TSLIB_ROTATE_CCW: samp.x = priv->height - samp.y;
- samp.y = tmp_x;
- break;
- default: break;
}
- priv->lastx = samp.x;
- priv->lasty = samp.y;
- x = samp.x;
- y = samp.y;
-
- xf86XInputSetScreen(local, priv->screen_num,
- samp.x,
- samp.y);
-
- xf86PostMotionEvent (local->dev, TRUE, 0, 2,
- x, y);
+ if(!!priv->lastp != !!samp.pressure) {
+ priv->lastp = samp.pressure;
+ xf86PostButtonEvent(local->dev, TRUE,
+ 1, !!samp.pressure, 0, 2,
+ priv->lastx,
+ priv->lasty);
+ }
}
- if(priv->lastp != samp.pressure) {
- priv->lastp = samp.pressure;
-
- xf86PostButtonEvent(local->dev, TRUE,
- 1, !!samp.pressure, 0, 2,
- priv->lastx,
- priv->lasty);
+ if (ret < 0) {
+ ErrorF("ts_read failed\n");
+ return;
}
}
@@ -348,7 +346,7 @@
s = xf86SetStrOption(pInfo->options, "TslibDevice", NULL);
- priv->ts = ts_open(s, 0);
+ priv->ts = ts_open(s, 1);
if (!priv->ts) {
ErrorF("ts_open failed (device=%s)\n",s);
return NULL;
Information forwarded
to debian-bugs-dist@lists.debian.org:
Bug#501139; Package xserver-xorg-input-tslib.
(Sat, 11 Oct 2008 23:09:02 GMT) (full text, mbox, link).
Acknowledgement sent
to Wen-Yen Chuang <caleb@calno.com>:
Extra info received and forwarded to list.
(Sat, 11 Oct 2008 23:09:02 GMT) (full text, mbox, link).
Message #15 received at 501139@bugs.debian.org (full text, mbox, reply):
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Mikko Rasa wrote:
> Package: xserver-xorg-input-tslib
> Version: 0.0.5-1
> Severity: normal
> Tags: patch
> When the variance module is enabled in ts.conf, the tslib input driver
> will emit a ButtonRelease event only when the pen is pressed the next
> time. This is because the variance module caches samples and will
> produce two samples on a release event, but the input driver is only
> prepared to receive one sample each time there is data available in
> the fd. A solution is to open the touchscreen in non-blocking mode
> and read as long as samples are available.
Thanks to Mikko.
I have tried this patch [1] on Zaurus SL-C3200.
It works fine.
I plan to upload 0.0.5-2 with this patch after release of Lenny.
I will also forward this patch to upstream.
Kind regards
Wen-Yen Chuang (caleb)
[1] http://bugs.debian.org/501139#10
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAkjxMUcACgkQdEpXpumNYVlylACcD2gAi7/LuBJKCdjJq6zQhkc6
KZIAn0om/pbhIJzJ/27hZqDSQYCK2PSe
=KdM+
-----END PGP SIGNATURE-----
Information forwarded
to debian-bugs-dist@lists.debian.org, Wen-Yen Chuang <caleb@calno.com>:
Bug#501139; Package xserver-xorg-input-tslib.
(Wed, 15 Oct 2008 09:45:10 GMT) (full text, mbox, link).
Acknowledgement sent
to Sascha Hauer <s.hauer@pengutronix.de>:
Extra info received and forwarded to list. Copy sent to Wen-Yen Chuang <caleb@calno.com>.
(Wed, 15 Oct 2008 09:45:11 GMT) (full text, mbox, link).
Message #20 received at 501139@bugs.debian.org (full text, mbox, reply):
Hi,
For easier readability I don't refer to the patch but to the code with
this patch applied:
> while((ret = ts_read(priv->ts, &samp, 1)) == 1) {
What does ts_read return when there's no more data available at the moment?
From looking at the tslib source code it is not clear to me whether it is 0
or -1.
> if(samp.pressure) {
> int tmp_x = samp.x;
>
> switch(priv->rotate) {
> case TSLIB_ROTATE_CW: samp.x = samp.y;
> samp.y = priv->width - tmp_x;
> break;
> case TSLIB_ROTATE_UD: samp.x = priv->width - samp.x;
> samp.y = priv->height - samp.y;
> break;
> case TSLIB_ROTATE_CCW: samp.x = priv->height - samp.y;
> samp.y = tmp_x;
> break;
> default: break;
> }
>
> priv->lastx = samp.x;
> priv->lasty = samp.y;
> x = samp.x;
> y = samp.y;
>
> xf86XInputSetScreen(local, priv->screen_num,
> samp.x,
> samp.y);
>
> xf86PostMotionEvent (local->dev, TRUE, 0, 2,
> x, y);
>
> }
>
> if(!!priv->lastp != !!samp.pressure) {
> priv->lastp = samp.pressure;
>
> xf86PostButtonEvent(local->dev, TRUE,
> 1, !!samp.pressure, 0, 2,
> priv->lastx,
> priv->lasty);
> }
> }
>
> if (ret < 0) {
> ErrorF("ts_read failed\n");
If it's -1 then message is issued whenever we leave this function. Test
for errno == -EAGAIN maybe?
Sascha
--
Pengutronix - Linux Solutions for Science and Industry
Handelsregister: Amtsgericht Hildesheim, HRA 2686
Hannoversche Str. 2, 31134 Hildesheim, Germany
Phone: +49-5121-206917-0 | Fax: +49-5121-206917-9
Reply sent
to Wen-Yen Chuang <caleb@calno.com>:
You have taken responsibility.
(Tue, 23 Dec 2008 10:14:49 GMT) (full text, mbox, link).
Notification sent
to Mikko Rasa <tdb@tdb.fi>:
Bug acknowledged by developer.
(Tue, 23 Dec 2008 10:15:28 GMT) (full text, mbox, link).
Message #25 received at 501139-close@bugs.debian.org (full text, mbox, reply):
Source: xf86-input-tslib
Source-Version: 0.0.5-3
We believe that the bug you reported is fixed in the latest version of
xf86-input-tslib, which is due to be installed in the Debian FTP archive:
xf86-input-tslib_0.0.5-3.diff.gz
to pool/main/x/xf86-input-tslib/xf86-input-tslib_0.0.5-3.diff.gz
xf86-input-tslib_0.0.5-3.dsc
to pool/main/x/xf86-input-tslib/xf86-input-tslib_0.0.5-3.dsc
xserver-xorg-input-tslib_0.0.5-3_amd64.deb
to pool/main/x/xf86-input-tslib/xserver-xorg-input-tslib_0.0.5-3_amd64.deb
A summary of the changes between this version and the previous one is
attached.
Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to 501139@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.
Debian distribution maintenance software
pp.
Wen-Yen Chuang <caleb@calno.com> (supplier of updated xf86-input-tslib package)
(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Format: 1.8
Date: Tue, 23 Dec 2008 12:23:45 +0800
Source: xf86-input-tslib
Binary: xserver-xorg-input-tslib
Architecture: source amd64
Version: 0.0.5-3
Distribution: experimental
Urgency: low
Maintainer: Wen-Yen Chuang <caleb@calno.com>
Changed-By: Wen-Yen Chuang <caleb@calno.com>
Description:
xserver-xorg-input-tslib - tslib touchscreen driver for X.Org/XFree86 server
Closes: 501139
Changes:
xf86-input-tslib (0.0.5-3) experimental; urgency=low
.
* Downgrade Build-Depends to libts-dev (>= 1.0-4)
* Update to latest xsfbs (http://git.debian.org/git/pkg-xorg/xsfbs.git)
.
xf86-input-tslib (0.0.5-2) experimental; urgency=low
.
* Build against libts-dev (>= 1.0-5)
* Update to latest xsfbs
* Fix button release events handling (Closes: #501139)
Thanks to Mikko Rasa.
* Support dynamic resolution, thanks to Graeme Gregory
* Support automatic device detection, thanks to Markku Vire
- add Recommends: hal
- include 10-x11-input-tslib.fdi
Checksums-Sha1:
539b61e1e011438c11c0f4c3dd827f1e1dd20f51 1175 xf86-input-tslib_0.0.5-3.dsc
7dad4781c04504f330d9e52efd21d831f29c4552 17484 xf86-input-tslib_0.0.5-3.diff.gz
323d3a65ff948057e3968ddaea26316f4ade6865 9510 xserver-xorg-input-tslib_0.0.5-3_amd64.deb
Checksums-Sha256:
6e70663c486fb0537f00bcff0ff8cd3c012663e0e446a76bfa2e9c8c007f9b18 1175 xf86-input-tslib_0.0.5-3.dsc
c81aec211382af110faeeca49f591fe40f69767519e0f455628279ec159bc864 17484 xf86-input-tslib_0.0.5-3.diff.gz
2494ed3979b57b6771d813c73271db8dcf66423b61e63c269c27af594937684f 9510 xserver-xorg-input-tslib_0.0.5-3_amd64.deb
Files:
9e328b8d62ab4ea3fe0e775133843bb6 1175 x11 optional xf86-input-tslib_0.0.5-3.dsc
25b6e903fc9163c9eed5e6225f77368c 17484 x11 optional xf86-input-tslib_0.0.5-3.diff.gz
2b32baf2713dfca7abb89ed031cb8450 9510 x11 optional xserver-xorg-input-tslib_0.0.5-3_amd64.deb
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
iEYEARECAAYFAklQspAACgkQiAEJSii8s+PhQwCgo37DpfGzBD5gSWFVLiC0i7Rl
b/8AoOHQ6KZY4KP6njNNYdj/A2//tg/6
=zwbD
-----END PGP SIGNATURE-----
Bug archived.
Request was from Debbugs Internal Request <owner@bugs.debian.org>
to internal_control@bugs.debian.org.
(Sat, 04 Apr 2009 07:31:11 GMT) (full text, mbox, link).
Send a report that this bug log contains spam.
Debian bug tracking system administrator <owner@bugs.debian.org>.
Last modified:
Sat Jul 8 21:54:36 2023;
Machine Name:
buxtehude
Debian Bug tracking system
Debbugs is free software and licensed under the terms of the GNU
Public License version 2. The current version can be obtained
from https://bugs.debian.org/debbugs-source/.
Copyright © 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson,
2005-2017 Don Armstrong, and many other contributors.