The touchscreen wasn't responding well. I bought a new display assembly to replace the old one.
Turned out the problem is probably with the digitizer connector on the logic board. There are a couple of little metal connections that seem to have broken, and the touch screen is consequently unresponsiv . . .