I have a Pi4B with a fresh install of Raspbian. I have a 4" touch LCD on HDMI0, and a 13" non-touch portable monitor on HDMI1, and I configured the workspaces so they don't overlap. I enabled touch with the following changes in config.txt:
dtparam=spi=on
hdmi_cvt 480 800 60 6 0 0 0
dtoverlay=ads7846,cs=1,penirq=25,penirq_pull=2,speed=50000,keep_vref_on=0,swapxy=0,pmax=255,xohms=150,xmin=200,xmax=3900,ymin=200,ymax=3900
(i didn't do the full install as recommended on that link, as that kills my ability to use 2 screens - see my previous question)
However, when using the touch screen, each point is mapped to the whole workspace instead of just the LCD. In other words, if I hit the bottom right corner of the LCD, the Pi registers a click at the bottom right of the large screen.
It probably sounds a bit confusing so an image being worth 1000 words:
Red is (approximately) where I touch; green is where it registers.
Note that this isn't actually affected by whether the second screen is connected or not.
Anybody know what I need to fiddle with to solve it? I just want to use the touch screen for touch input.