Touch events appear offset with presence of a second monitor

Ben Gamari ben at smart-cactus.org
Fri Jan 2 10:49:01 PST 2015


Hello all,

My Latitude E7440 has a touch screen panel and a few external display
interfaces. I've noticed that when I plug in an external monitor touch
events no longer correspond to the location I have touched on the panel.

For instance, take the case where I have an external HDMI monitor with
the same native resolution as my panel. If I place the external monitor
to the left of the panel,

    xrandr --output HDMI1 --left-of eDP1 --auto
    
I find that touches on the panel map to the corresponding point on the
external monitor.

If I place the monitor to the right of the panel, touches map to the
panel as expected. This isn't terribly surprising: the input presumably
has no idea that the touch device has any particular relation to the
panel so the input device events are mapped to a location relative to
the origin of the screen, not the panel. How is this situation supposed
to be handled? Is ensuring that input devices and output geometries
remain consistent left up to higher layers of the stack? This would be
straightforward if xinput transformation matrices could encode
translations; unfortunately it appears that they can not.

It does appear, however, that some component in the stack is updating
the input transformation matrix of the input device when the output
geometry is invoked. For instance after I light up the external display
on either the right or left side of the panel the transformation matrix
for the touch screen is,

    Coordinate Transformation Matrix (141):	0.500000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000

Unfortunately, whatever is doing this does not reset the transformation
matrix when the external monitor is disabled, resulting in the input
events to be incorrectly scaled (e.g. a touch event on the right edge of
the panel places the cursor at the middle of the screen). Does anyone
know component of the stack is responsible for this update and why it
fails to handle the `--off` case properly?

Cheers,

- Ben
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 472 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg/attachments/20150102/fa627e4c/attachment.sig>


More information about the xorg mailing list