Inconsistent mouse events for Acer T231H multitouch monitor
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
HWE Next |
Fix Released
|
Undecided
|
Unassigned | ||
Saucy |
Fix Released
|
Undecided
|
Unassigned | ||
X.Org X server |
Fix Released
|
Medium
|
|||
xorg-server (Ubuntu) |
Fix Released
|
High
|
Chase Douglas | ||
Precise |
Won't Fix
|
Undecided
|
Maarten Lankhorst |
Bug Description
I already submitted this at http://
My setup is a quantal alpha 1, just upgraded from precise, with an Acer T231H multitouch monitor connected to it, as well as an ordinary mouse for testing. The mouse events as X sends them to the applications are inconsitent. This can be debugged using xev.
The first touch of the screen is preceeded by a MotionNotify event which already has state 0x100, i.e. left mouse button pressed. After that comes a ButtonPress event, again with state 0x100 although that value should indicate the state of the buttons before the event occurred. The subsequent drag is all right, and the ButtonRelease as well, but the 0x100 bit in the state value will never become zero again.
Even if I've got an ordinary mouse connected as well, it will henceforth report every movement as if I were keeping the left mouse button down. The only cure that I could find was restarting the X server. Together with the ButtonPress and ButtonRelease events, this constant bit for left mouse button amounts to an inconsistent reporting of button state.
Java applications e.g. will report every move as a drag due to this issue, with severe implications for focus management. This makes using differenent parts of the application almost impossible, as mouse movement will only be reported to the component where the mouse entered the application window.
Since reporting at askubuntu, I've run some tests with evtest. The data coming from the event device looks sane enough: BTN_TOUCH events for the first finger, with value 1 for pressed and 0 for released. ABS_MT_TRACKING_ID for all fingers, with a non-negative value for pressed and -1 for released. The grouping into syn groups looks sane as well. So I'd say the kernel driver works as intended, and somewhere from there to the xevent layer, some internal state gets messed up.
I'm willing to try out any patches you might propose, be it in an attempt to fix this, or only to gather more information.
Expected behaviour:
MotionNotify with state 0x000 when dragging the ordinary mouse
MotionNotify with state 0x000 for move prior to touch, or no event at all
ButtonPress with state 0x000 when touching the screen
MotionNotify with state 0x100 while dragging the finger
ButtonRelease with state 0x100 when lifting the finger
MotionNotify with state 0x000 when dragging the ordinary mouse afterwards
Actual behaviour:
MotionNotify with state 0x000 when dragging the ordinary mouse before the first touch
MotionNotify with state 0x100 for prior to ButtonPress event
ButtonPress with state 0x100 when touching the screen
MotionNotify with state 0x100 while dragging the finger
ButtonRelease with state 0x100 when lifting the finger
MotionNotify with state 0x100 when dragging the ordinary mouse afterwards
ProblemType: Bug
DistroRelease: Ubuntu 12.10
Package: xserver-
ProcVersionSign
Uname: Linux 3.4.0-5-generic x86_64
ApportVersion: 2.2.3-0ubuntu5
Architecture: amd64
CurrentDmesg: [ 7.381404] ADDRCONF(
Date: Tue Jun 19 17:56:46 2012
DistUpgraded: 2012-06-19 17:51:23,756 DEBUG enabling apt cron job
DistroCodename: quantal
DistroVariant: ubuntu
InstallationMedia: Ubuntu 12.04 LTS "Precise Pangolin" - Release amd64 (20120425)
ProcEnviron:
TERM=xterm
PATH=(custom, no user)
LANG=en_US.UTF-8
SHELL=/bin/bash
ProcKernelCmdLine: BOOT_IMAGE=
SourcePackage: xserver-
UpgradeStatus: Upgraded to quantal on 2012-06-19 (0 days ago)
dmi.bios.date: 09/22/2011
dmi.bios.vendor: American Megatrends Inc.
dmi.bios.version: 4.6.4
dmi.board.name: AMD HUDSON-M1
dmi.board.vendor: ZOTAC
dmi.chassis.type: 3
dmi.modalias: dmi:bvnAmerican
version.compiz: compiz 1:0.9.7.8-0ubuntu3
version.ia32-libs: ia32-libs N/A
version.libdrm2: libdrm2 2.4.33-1
version.
version.
version.
version.
version.
version.
version.
version.
tags: | added: kubuntu |
tags: | added: touch |
tags: | added: blocks-hwcert-enablement |
Changed in xorg-server: | |
importance: | Unknown → Medium |
status: | Unknown → In Progress |
Changed in hwe-next: | |
status: | New → In Progress |
assignee: | nobody → James M. Leddy (jm-leddy) |
Changed in xorg-server: | |
status: | In Progress → Fix Released |
Changed in hwe-next: | |
assignee: | James M. Leddy (jm-leddy) → nobody |
I had hoped that backing http:// cgit.freedeskto p.org/xorg/ xserver/ commit/ ?id=634b0da9a83 076d0e9e0fc44dc 5dc77b0c368bc1 out of the xorg server core code base might be enough to solve this, but if I do so, core events never have any buttons set in their state, so that is not a solution. Nevertheless, it might well be that this problem lies somewhere inside the xorg server itself, and not the evdev driver module. Although I haven't yet pinpointed the location in the sources where that state is managed, it seems to me as if the evdev code were pretty stateless, submitting only button press and release events as appropriate. And as those apparently arrive correctly at xev, the state management appears to be wrong for some other reason.
Searching for ways to obtain more information, I just ran "xinput test-xi2 2" where 2 is the id of my virtual core pointer. When I drag my finger inside the test window, here is what I see in the console (after enlarging my scrollback appropriately):
- DeviceChanged due to SlaveSwitch
- RawTouchBegin
- Enter, buttons: (empty)
- Motion (emulated), buttons: 1
- ButtonPress (emulated), buttons: 1
- Motion (emulated), buttons: 1, repeated while dragging
- ButtonRelease (emulated), buttons: 1
- TouchBegin, buttons: (empty)
- TouchUpdate: buttons: (empty), repeated to mimic the original drag
There are a number of things very strange about this: TouchUpdate sequence only gets emitted after I release my finger.
- The whole TouchBegin/
- The TouchBegin does not have a matching TouchEnd. Very likely this causes the error in core event state.
- After I release my finger, the mouse cursor jumps to the location where I began my drag.
This behaviour is only within the xinput test window, outside the cursor will stay at the end of a drag.
Repeating the test for input device 9, which is the touch screen, I see this:
- RawTouchBegin
- Motion (emulated), button: 1
- TouchBegin, buttons: (empty)
- ButtonPress (emulated), buttons: 1
- RawTouchUpdate
- TouchUpdate, buttons: (empty)
- Motion (emulated), buttons: 1
- The preceeding three events repeated in this order for the duration of the drag
- RawTouchEnd
- TouchEnd, buttons: (empty)
- ButtonRelease (emulated), buttons: 1
So here the Touch events are delivered in sync with the Motion events, there is a TouchEnd where one would expect it to be. The jumping of the mouse cursor to the position where the drag began still remains, though.
To me this looks a lot as if the events made it into the dix layer all right, but the emulation of a core pointer based on these events is somehow broken. For this reason, I now believe the problem to lie within the xserver-xorg-core binary package.
"xinput test 2" does not work at all ("unable to find device 2"), whereas "xinput test 9" shows pretty sane behaviour: a single motion followed by a button press 1 at the beginning, a sequence of motion events during the drag, and a button release 1 at the end. When launched with the -proximity flag, it complains of a bad request and terminates immediately. Makes sense, as this device doesn't provide any proximity information.