8

I switched my ubuntu from 21.10 impish to 22.04 jammy which implied to leave x11 for wayland.

I prevented unsolicited selection paste or unwanted closed tabs by completely disabling middle click with this line into my .bashrc :

xinput set-prop 'Synaptics TM3289-021' 'libinput Middle Emulation Enabled' 1

It was working fine with x11. After the upgrade, I get this error message

WARNING: running xinput against an Xwayland server. See the xinput man page for details.

unable to find device Synaptics TM3289-021

When I do xinput list, I don't get my touchpad but rather

WARNING: running xinput against an Xwayland server. See the xinput man page for details.
⎡ Virtual core pointer                      id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
⎜   ↳ xwayland-pointer:16                       id=6    [slave  pointer  (2)]
⎜   ↳ xwayland-relative-pointer:16              id=7    [slave  pointer  (2)]
⎜   ↳ xwayland-pointer-gestures:16              id=8    [slave  pointer  (2)]
⎣ Virtual core keyboard                     id=3    [master keyboard (2)]
   ↳ Virtual core XTEST keyboard               id=5    [slave  keyboard (3)]
   ↳ xwayland-keyboard:16                      id=9    [slave  keyboard (3)]

How can I disable middle click with Wayland protocol?

2
  • 3
    Facing the same issue. Did you find a solution?
    – IttayD
    Jun 16, 2022 at 4:24
  • For gnome: gsettings set org.gnome.desktop.peripherals.touchpad middle-click-emulation true Jul 5, 2022 at 3:46

2 Answers 2

7

Solution

Use the command:

gsettings set org.gnome.desktop.peripherals.touchpad middle-click-emulation true

When we enable middle click emulation, if there is a real middle button on your touchpad he'll be disabled. You don't need to put it into your .bashrc to keep it persistant. Here is the property description. You can customize it using dconf-editor gui (faster than command line)

If you don't know what dconf is.

Why it wasn't working anymore

Wayland use libinput is instead of xinput. Therefore, you won't be able to change settings with xinput anymore. Libinput on wayland More informations on libinput documentation

Bonus: Exploring /dev/input

I found this very interesting tutorial explaining how to explore input devices.

Here is some python3 code to discover mouse input:

import struct
f = open( "/dev/input/mouse0", "rb" );
while 1:
  data = f.read(3)                 # Reads the 3 bytes
  print(struct.unpack('3b',data))  # Unpacks the bytes to integers

Save it into a file.py and run sudo python3 file.py

3
  • Then you shouldn't have the problem and fixing it using: xinput set-prop 'your device' 'libinput Middle Emulation Enabled' 1. Jul 6, 2022 at 17:47
  • This solution doesn't work. Thinkpad L14, Ubuntu 22.04 Oct 3, 2022 at 9:59
  • Solution DOES work on Ubuntu 22.04 on HP laptop. Annoying middle button is gone.
    – igor
    Apr 11, 2023 at 12:06
0

I got this method from the Hyprland FAQ, and it works great!

wl-paste -p --watch wl-copy -p ''

It requires wl-clipboard to be installed.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .