Touch events appear offset with presence of a second monitor

Ben Gamari ben at smart-cactus.org
Sun Jan 4 17:46:17 PST 2015


Hi Peter,

Peter Hutterer <peter.hutterer at who-t.net> writes:

> On Fri, Jan 02, 2015 at 01:49:01PM -0500, Ben Gamari wrote:
> 
[snip]

>> 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.
>
Hmm, still not sure I see how translations are handled. How does the
server know which output the input device is supposed to "follow"?

Interestingly enough, my touchscreen correctly reports itself as an
absolute device and yet, as reported above, still doesn't handle
translations properly (see evemu output below).


>> 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
>
Thanks for the pointer!

Cheers,

- Ben



# EVEMU 1.2
# Input device name: "ELAN Touchscreen"
# Input device ID: bus 0x03 vendor 0x4f3 product 0x111 version 0x110
# Supported events:
#   Event type 0 (EV_SYN)
#     Event code 0 (SYN_REPORT)
#     Event code 1 (SYN_CONFIG)
#     Event code 2 (SYN_MT_REPORT)
#     Event code 3 (SYN_DROPPED)
#     Event code 4 ((null))
#     Event code 5 ((null))
#     Event code 6 ((null))
#     Event code 7 ((null))
#     Event code 8 ((null))
#     Event code 9 ((null))
#     Event code 10 ((null))
#     Event code 11 ((null))
#     Event code 12 ((null))
#     Event code 13 ((null))
#     Event code 14 ((null))
#   Event type 1 (EV_KEY)
#     Event code 330 (BTN_TOUCH)
#   Event type 3 (EV_ABS)
#     Event code 0 (ABS_X)
#       Value   1002
#       Min        0
#       Max     3968
#       Fuzz       0
#       Flat       0
#       Resolution 13
#     Event code 1 (ABS_Y)
#       Value   1043
#       Min        0
#       Max     2240
#       Fuzz       0
#       Flat       0
#       Resolution 13
#     Event code 47 (ABS_MT_SLOT)
#       Value      0
#       Min        0
#       Max        9
#       Fuzz       0
#       Flat       0
#       Resolution 0
#     Event code 48 (ABS_MT_TOUCH_MAJOR)
#       Value      0
#       Min        0
#       Max      255
#       Fuzz       0
#       Flat       0
#       Resolution 1
#     Event code 49 (ABS_MT_TOUCH_MINOR)
#       Value      0
#       Min        0
#       Max      255
#       Fuzz       0
#       Flat       0
#       Resolution 1
#     Event code 52 (ABS_MT_ORIENTATION)
#       Value      0
#       Min        0
#       Max        1
#       Fuzz       0
#       Flat       0
#       Resolution 0
#     Event code 53 (ABS_MT_POSITION_X)
#       Value      0
#       Min        0
#       Max     3968
#       Fuzz       0
#       Flat       0
#       Resolution 13
#     Event code 54 (ABS_MT_POSITION_Y)
#       Value      0
#       Min        0
#       Max     2240
#       Fuzz       0
#       Flat       0
#       Resolution 13
#     Event code 57 (ABS_MT_TRACKING_ID)
#       Value      0
#       Min        0
#       Max    65535
#       Fuzz       0
#       Flat       0
#       Resolution 0
#     Event code 60 (ABS_MT_TOOL_X)
#       Value      0
#       Min        0
#       Max     3968
#       Fuzz       0
#       Flat       0
#       Resolution 13
#     Event code 61 (ABS_MT_TOOL_Y)
#       Value      0
#       Min        0
#       Max     2240
#       Fuzz       0
#       Flat       0
#       Resolution 13
# Properties:
#   Property  type 1 (INPUT_PROP_DIRECT)
N: ELAN Touchscreen
I: 0003 04f3 0111 0110
prop bit set for 1
P: 02 00 00 00 00 00 00 00
B: 00 0b 00 00 00 00 00 00 00
B: 01 00 00 00 00 00 00 00 00
B: 01 00 00 00 00 00 00 00 00
B: 01 00 00 00 00 00 00 00 00
B: 01 00 00 00 00 00 00 00 00
B: 01 00 00 00 00 00 00 00 00
B: 01 00 04 00 00 00 00 00 00
B: 01 00 00 00 00 00 00 00 00
B: 01 00 00 00 00 00 00 00 00
B: 01 00 00 00 00 00 00 00 00
B: 01 00 00 00 00 00 00 00 00
B: 01 00 00 00 00 00 00 00 00
B: 01 00 00 00 00 00 00 00 00
B: 02 00 00 00 00 00 00 00 00
B: 03 03 00 00 00 00 80 73 32
B: 04 00 00 00 00 00 00 00 00
B: 05 00 00 00 00 00 00 00 00
B: 11 00 00 00 00 00 00 00 00
B: 12 00 00 00 00 00 00 00 00
B: 14 00 00 00 00 00 00 00 00
B: 15 00 00 00 00 00 00 00 00
B: 15 00 00 00 00 00 00 00 00
A: 00 0 3968 0 0 13
A: 01 0 2240 0 0 13
A: 2f 0 9 0 0 0
A: 30 0 255 0 0 1
A: 31 0 255 0 0 1
A: 34 0 1 0 0 0
A: 35 0 3968 0 0 13
A: 36 0 2240 0 0 13
A: 39 0 65535 0 0 0
A: 3c 0 3968 0 0 13
A: 3d 0 2240 0 0 13
-------------- 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/20150104/dd8d5e92/attachment.sig>


More information about the xorg mailing list