Problem with touchscreen events and grabs

Phil Hannent phil at hannent.co.uk
Fri Oct 12 07:06:23 PDT 2012


Good afternoon,

I am new to the list so please excuse me for jumping in, however I develop
software for use with touch screens.  I have experienced the exact same
problem but with Windows 7 (I know, wrong platform).  However the root
cause was with the device itself either missing event signals or them being
out of order.

>From your email you imply you've only looked at the output of X, rather
than what is coming from the device via USB.

Regards
Phil

On 12 October 2012 14:38, Thierry Reding
<thierry.reding at avionic-design.de>wrote:

> Hi,
>
> I've been seeing a very strange issue. Originally this was observed when
> using a browser with an onscreen keyboard. It would sometimes happen
> that the keys on the keyboard would get stuck and be repeatedly sent.
>
> While trying to debug this, I came across a reliable way to reproduce it
> using xwininfo. Basically I would run xwininfo and select the onscreen
> keyboard. This would immediately result in the key being pressed and not
> receiving a release event. Using other keys on the onscreen keyboard
> would make them pressed as well, but never released either, resulting in
> repeated keypresses received by the browser. It seems like X for some
> reason believes that the press event is actually a release and vice-
> versa.
>
> In order to find out what exactly was going on, I fired up xev with the
> window XID as reported by xwininfo. This would indeed show the repeated
> key events sent to the onscreen keyboard's window. Strangely enough, if
> xev is started without an existing window XID, generating touch events
> in that window seems to "fix" the issue. The keyboard can be used
> reliably again.
>
> Furthermore, when running xwininfo and selecting the onscreen keyboard,
> a second call to xwininfo would fail, saying it cannot grab the mouse.
> This issue can be reliably reproduced independent of the onscreen
> keyboard and works with any X window. So opening an xterm for instance,
> then running xwininfo and selecting xterm will cause any subsequent
> calls to xwininfo to fail. Running xev and generating touch events in
> its window again fixes things.
>
> It seems like the X server doesn't properly release the grab and gets
> the touch down and up events mixed up. Note that all of this only
> happens when using a touchscreen device. Performing the same tests using
> a regular USB mouse to select the X window for xwininfo doesn't show the
> same behaviour.
>
> I'm using version 1.13 of the X server and xf86-input-evdev 2.7.3. Can
> anybody else reproduce this?
>
> If you need any more information I'd be happy to provide it.
>
> Thierry
>
> _______________________________________________
> xorg-devel at lists.x.org: X.Org development
> Archives: http://lists.x.org/archives/xorg-devel
> Info: http://lists.x.org/mailman/listinfo/xorg-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.x.org/archives/xorg-devel/attachments/20121012/60cfb947/attachment-0001.html>


More information about the xorg-devel mailing list