How to disable the touchscreen in Ubuntu 21.04?

I faced a problem after a couple of days that my malfunctioned touchscreen was on unexpectedly, despite setting MatchIsTouchscreen "off" at /usr/share/X11/xorg.conf.d/40-libinput.conf

How to make it disabled just like Ubuntu 20 and the older versions?


So after hours of searching a solution to that is keep that configuration MatchIsTouchscreen "off" and to make Xinput runs by default again to apply that configuration.

To disable Wayland:

  1. open the file: sudo nano /etc/gdm3/custom.conf
  2. uncomment (remove # from): WaylandEnable=false