Bug 50664 - Jumping pointer when modifiying "Coordinate transformation Matrix" for touchscreens/tablets
Summary: Jumping pointer when modifiying "Coordinate transformation Matrix" for touchs...
Status: RESOLVED MOVED
Alias: None
Product: xorg
Classification: Unclassified
Component: Server/Input/Core (show other bugs)
Version: unspecified
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Xorg Project Team
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-03 23:46 UTC by david
Modified: 2018-12-17 17:25 UTC (History)
4 users (show)

See Also:
i915 platform:
i915 features:


Attachments
patch (960 bytes, patch)
2012-08-20 21:30 UTC, zsalzbank
no flags Details | Splinter Review

Description david 2012-06-03 23:46:25 UTC
I have a portable dual screen Acer Iconia LX. It's like a big nintendo DS, but each screen is a tactile one. By default, X thinks there is a unique desktop composed by the two screens, so when I touch the superior one in its inferior half, the pointer goes to the screen below. Same thing with the inferior touchpanel: when I press the screen in its upper half, the cursor goes to the upper panel.

I've tried to modify the "Coordinate Transformation Matrix" associated to each touchscreens in order to limit the "movement" to its own screen. Something like:

# xinput set-prop "superior Touchpanel" "Coordinate Transformation Matrix" 1 0 0 0 0.5 0 0 0 1

That way, the reported coordinate would be 1/2 of the reported and the cursor must remain in its screen (the matrix for the inferior screen would be a little different, but I think you get the idea)

I don't know why, but NOT ALL THE EVENTS SEEMS AFFECTED BY THE TRANSFORMATION. If you make a "xinput test" on the device, you can see "sporadic jumps" in the informed "Y" coordinate of the "motion event". The final result is that the pointer doesn´t follow exactly your finger's movement, and sometimes it jumps ramdomly. The "button release" event always fails, reporting an "Y" coordinate which is the half of what it must be.

Something similar, with the "X" coordinate, if you modify the associated matrix parameters. Looks like there is a problem with NON-INTEGER (-1< x< 1) factors.

If you try to use a program like "gimp" with this behavior...

It doesn´t like to be a Acer Iconia -it's a weird computer, yes- problem. IT HAPPENS WITH A WACOM TABLET TOO, when you modify the matrix in order to limit the movements to a section of the screen. I've tried several linux kernels from the 3.x series, and with differents linux distributions -and even different X versions- No changes so far.

I suppose there is a bug in the code that multiplies the coordinates vector with the transformation matrix, but...
Comment 1 Marcelo 2012-06-06 16:00:34 UTC
This bug seems to be a dup of bug #40169. However, the description given by the reporter here is far more complete than that of the other bug. On the other hand, the reporter of bug #40169 has possibly identified the source file to be modified.

I have this problem too. Single clicks do not work on the touchscreen, probably because the button release event fails, as described by the reporter. When I tap the screen, the cursor goes to the place where I touched the screen, but as soon as I release the finger the cursor jumps to some random position and the click is not registered.
My configuration is two 1920x1080 monitors physically placed one above the other. The bottom monitor has a touchscreen, the upper one does not. I use the following xinput command:
xinput set-prop "Quanta OpticalTouchScreen" "Coordinate Transformation Matrix" 1 0 0 0 0.5 0.5 0 0 1

The coordinate transformation seems to take place correctly after the above command is issued, i.e., X understands that the touchscreen covers only the bottom monitor and not the entire desktop. However, the touchscreen becomes unusable because it's not possible to click anywhere by tapping and the random mouse movements that occur when dragging or drawing make it impossible to perform these actions using the touchscreen.
Comment 2 Marcelo 2012-06-06 18:18:15 UTC
Besides the above mentioned problems with the touchscreen after setting the coordinate transformation matrix, the mouse also starts to behave strangely. In many occasions, it behaves as if the left button was stuck down. Some examples:

1. In Libreoffice Calc, if I hover the mouse over the zoom control bar in the bottom right corner of Calc's window, the mouse grabs the zoom control by itself, without me clicking any button. If I move the mouse left and right, without ever touching its buttons, it drags the zoom control left and right.

2. In Libreoffice Calc, if I left-click a tab other than the currently selected one, the new tab is selected as expected, but the mouse behaves as if the clicked button had stuck. When I move the mouse after selecting another tab, the mouse cursor changes to the arrow with the little rectangle, as if it was dragging a cell.

3. In Chromium, if I right-click a link and left-click "Open link in new tab", the mouse behaves as if the left-click stuck. When I move the mouse after opening the new tab, the mouse cursor changes to the little hand grabbing a sheet, as if I was moving the clicked link.

4. In Chromium, if I middle-click a link to open it in a new tab and then left-click the newly opened tab, the mouse cursor changes to the cross with arrowed points (the move window cursor) and the window is restored, as if I had started to drag it and let it go right after.

5. In Handbrake, when a dialog opens, hovering the mouse over its text without pressing any button selects the text.
Comment 3 Lyude Paul 2012-07-09 20:56:02 UTC
I can confirm this bug too with a Lenovo S10-3t with a Cando multitouch screen. I would also like to note that upon Googling this bug, I noticed that Ubuntu has already seen it and fixed it. Sadly however, I am on Gentoo, so their fix does not apply. However, maybe their patch should be merged upstream?
The launchpad bug is here: https://bugs.launchpad.net/ubuntu/+source/xorg-server/+bug/774938
Comment 4 zsalzbank 2012-08-20 14:43:51 UTC
I am having the same issue.  When I set the matrix back to the identity matrix, the jumping stops, but the cursor position is always wrong.
Comment 5 zsalzbank 2012-08-20 21:30:23 UTC
Created attachment 65850 [details] [review]
patch

I was able to resolve the cursor jumping issue in 12.04 by using the attached patch.  It is originally from:

https://bugs.freedesktop.org/show_bug.cgi?id=49347
Comment 6 Lyude Paul 2012-08-22 00:04:16 UTC
Comment on attachment 65850 [details] [review]
patch

Review of attachment 65850 [details] [review]:
-----------------------------------------------------------------

I got the patch to work with Xorg version 1.12.2, but it did not have any effect and the bug was still present. I failed to apply the patch to any newer versions of Xorg.
Also just a note, X is not officially part of the Ubuntu project. I think you assumed that from somewhere because X is included with Ubuntu, but the development of X is not specifically aimed at Ubuntu at all (although there are a few guys at canonical who make a very large number of patches for X and help maintain the project). So to many people, referring to version 12.04 of Ubuntu means nothing on a bug that is present in Xorg.
Comment 7 zsalzbank 2012-08-22 00:59:21 UTC
I realize that.  Sorry for the confusion - I copied and pasted from my response to the Ubuntu bug.  The version of X that this worked on for me was 1.11.4.
Comment 8 joseph yarbrough 2012-10-02 23:45:14 UTC
Trying to find 1.11.4 so I can patch it and install it, but I've been unable to figure out which X version matches the xorg-server version.

This is still present on extra/xorg-server 1.12.4-1 on arch linux.

I dove into the code today but it was 2000 lines of mostly gibberish for me. I don't understand the data structures or much of what was going on.

I'm going to make a video explaining exactly the symptoms I'm seeing because the mouse cursor does not jump to "a random place". Also it seems to be two bugs in one. One for clicks/finger lifts and one for finger holds.
Comment 9 Yaroslav 2013-01-31 07:03:00 UTC
This should be related:

https://bugs.launchpad.net/ubuntu/+source/xorg-server/+bug/774938
Comment 10 MikaelLaineA 2013-04-25 08:37:04 UTC
Since so many are having this problem, and since I've had to patch my xserver-xorg-core so many times(!) I created instructions (and a script) to do it.

If you are a newb and don't know how to do this, read this:

http://tricklestreamcoding.blogspot.fi/2013/04/cursor-jumps-on-touchscreens-ubuntu.html
Comment 11 GitLab Migration User 2018-12-17 17:25:54 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/xorg/xserver/issues/558.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.