How to fix palm detection in Ubuntu 17.04

Synaptics user space driver is not very good in palm detection.

In Ubuntu 17.04 libinput is the default user space driver. It is not istalled for some reason.

Run in a terminal

sudo apt install xserver-xorg-input-libinput

to install it. Then reboot.

Tapping may be disabled by default. Edit /usr/share/X11/xorg.conf.d/40-libinput.conf to look this way:

# Match on all types of devices but tablet devices and joysticks
Section "InputClass"
    Identifier "libinput pointer catchall"
    MatchIsPointer "on"
    MatchDevicePath "/dev/input/event*"
    Driver "libinput"
EndSection


Section "InputClass"
    Identifier "libinput keyboard catchall"
    MatchIsKeyboard "on"
    MatchDevicePath "/dev/input/event*"
    Driver "libinput"
EndSection

Section "InputClass"
    Identifier "libinput touchpad catchall"
    MatchIsTouchpad "on"
    MatchDevicePath "/dev/input/event*"
    Driver "libinput"
    Option "Tapping" "True"
    Option "NaturalScrolling" "True"
EndSection

Section "InputClass"
    Identifier "libinput touchscreen catchall"
    MatchIsTouchscreen "on"
    MatchDevicePath "/dev/input/event*"
    Driver "libinput"
EndSection

Section "InputClass"
    Identifier "libinput tablet catchall"
    MatchIsTablet "on"
    MatchDevicePath "/dev/input/event*"
    Driver "libinput"
EndSection

to enable tapping and natural scrolling.