Touch events appear offset with presence of a second monitor
peter.hutterer at who-t.net
Sun Jan 4 16:10:38 PST 2015
On Fri, Jan 02, 2015 at 01:49:01PM -0500, Ben Gamari wrote:
> 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.
yes, supposed to be handled by the rest of the stack. the X server doesn't
change the matrix, it only reads it. and translations are handled on
absolute devices, but they're just ignored for relative devices.
> 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?
gnome-settings-daemon most likely, file plugins/common/gsd-device-mapper.c
More information about the xorg