behaviour of touchscreen in virtual scrolled view
Summary
Virtual desktop scroll seems missconsidered by touch events
Steps to reproduce
This is not the only case, but I'm going to detail my preferred configuration possibly very common:
Laptop with FHD touch screen is in vertical position (1080x1920) on the left of a 4k monitor (3840x2160). Note that the laptop in vertical position has 1920 lines which are similar to 2160 lines of the 4k monitor.
Logical position:
+ ------------- +
+ --- + |
| | |
| | |
+ --- + ------------- +
Effective physical position (being not in the same plane a vision can imagine/complete to both the following cases, with effective virtual vertical scrolling for the laptop monitor only):
+ ------------- + + --- + + ------------- +
+ --- + | | | | | |
| | | | | | | |
| | | | up to + --- + | |
+ --- + + ------------- + + ------------- +
Is possible to explore the left off band over or under, with the mouse.
I invoke the following commands to set the described configuration (your touchscreen might have a different name, see with xinput |grep touch
):
xrandr --fb $((1080+3840))x2160 --output eDP --primary --mode 1920x1080 --rotate left --pos 0x0 --panning 2160x0+$((2160-1920))+0/1080x1920+0+0 --output HDMI-A-0 --auto --pos 1080x0
touchscreen='Wacom HID 5218 Finger touch'
xinput set-prop "$touchscreen" 'Coordinate Transformation Matrix' 0 -0.21951219512195122 0.21951219512195122 0.888888888888 0 0 0 0 1
but this transformation matrix is OK when the screen are aligned on top, not sufficient to handle the touch event when the screen is scrolled.
Note: I determined with experiment the right way to invoke the commands (man xrandr
was not very clear about --panning and the --mode that finally did what I intended was in my opinion not much intuitive for an already said 90 degree rotated screen and for what I know as "mode" traditional meaning for CRT). Then the proportional numbers used as transformation matrix are from 1080/(1080+3840)=0.21951219512195122, 1920/2160=0.8888888888888888.
If not many faced the issue before, might be only because is complicate to obtain this great way to creatively use two screens.
I think that the problem is that the scrolled virtual position is ignored when touch event is applied to set the new pointer coordinates