I tried reinsatalling the touchpad driver, but the issue persisted. I tried updating the driver automatically but Windows said the driver is the latest driver found. So, the problem persisted.
I connected an external mouse so that the screen didn't blink and then noticed there were some windows updates pending. I ran windows update, restarted the laptop, then ran again windows update and restarted, until I finally could use the touchpad without the screen having to blink.
I don't know which update did the work, but updating Windows fixed the problem.