Right-clicking on \ hovering over Chrome browser tabs not working

I'm using Ubuntu 20.04 on an essentially-brand-new Lenovo IdeaPad 3 (with an external USB mouse), and use Google Chrome as my primary web browser. Lately, I've been having a really irritating problem: sometimes, seemingly at random, Chrome loses the ability to sense when I right-click on a browser tab or on the forward/back buttons, and attempting to right-click on a tab or one of the aforementioned buttons simply triggers the left-click action for what was clicked on, rather than bringing up the requisite right-click menu. Hovering the cursor over a tab also no longer brings up the name of the webpage in that tab, no matter how long the cursor stays over the tab. Sometimes, Chrome spontaneously starts responding to right-clicks and tab hovering again, but sometimes the right-click-nonresponsiveness lasts for the whole rest of the browsing session.

What the hell is going on and how do I fix it?

EDIT: The problem resolved itself after I inadvertently brought up the on-screen keyboard (I spotted a speck of dust on the touchscreen, and, in brushing it off, activated the on-screen keyboard); after dismissing the keyboard, tab right-clicking and hovering worked properly again. Still confused as hell, though.


Solution 1:

I had the same issue on Ubuntu 20.04, right clicking / middle clicking on Chrome tabs respectively didn't bring the menu / close the tab.

This was due to the touch screen of my laptop (I imagine Chrome thought I was on a tablet).

I also spotted issues with Nautilus: drag'n'drop triggered too often.

To fix it, I disabled the touch screen:

xinput --disable $(xinput --list | grep -i 'finger touch' | grep -o 'id=[0-9]*' | sed 's/id=//')

Notes:

  • "finger touch" needs to be replaced with a part of your touch screen's name, it can be retrieved with xinput list, e.g. on my side:
    ⎡ Virtual core pointer                        id=2    [master pointer  (3)]
    ⎜   ↳ Virtual core XTEST pointer                  id=4    [slave  pointer (2)]
    ⎜   ↳ DP-1                                        id=8    [slave  pointer (2)]
    ⎜   ↳ Wacom HID 4943 Finger touch                 id=11   [slave  pointer (2)]
    ⎜   ↳ DLL0945:00 06CB:CDE6 Touchpad               id=13   [slave  pointer (2)]
    ⎜   ↳ MX Keys Consumer Control                    id=21   [slave  pointer (2)]
    
  • This command must be rerun after a reboot (to avoid that, I add it to my ~/.bashrc).

Solution 2:

I was able to stop this behaviour by tapping once anywhere on the touch screen.

Dorian's answer reminded me of an issue with IntelliJ, where the mitigation was the same.