I had this problem for a long time. I recently updated
to Ubuntu 19.10 and it was still there, so I poked around
again for solutions. It appears that this is due to having
the (apparently obsolete) "synaptics" input driver installed
either instead of or in addition to the "libinput" driver.
To correct this, run these two commands:
sudo apt install xserver-xorg-input-libinput
sudo apt remove xserver-xorg-input-synaptics