Ubuntu – Non-focused windows not responding to mouse clicks

20.04focusgnomemouse

I am encountering a problem wherein, after using Ubuntu 20.04 for awhile, non-focused windows stop responding to mouse clicks (and thus do not gain focus). Furthermore the title bar of even the focused window doesn't recognize the mouse, so I can't, for example, move or close the window by clicking on the title bar. While I can switch between windows with Alt-Tab, the desktop itself (including the launcher) is completely unresponsive. Locking the screen does not help; however, logging out does. (So to turn the computer off using the GUI, I first have to log out with Ctrl-Alt-Del, and then am able to select Power Off from the greeter.) Also, hover actions work correctly (except on the desktop and title bars); it is just clicks that don't work.

(By the way, I have just noticed that two-finger scrolling works even without focus (my "mouse" is really a touchpad), but clicking on the scrollbar doesn't. And now I've just noticed that the "title bar" of "Files" (nautilus) works as long as the window has focus, and the launcher responds to Super+#.)

If anyone knows how to fix this I would be most appreciative.

Thanks,
-Travis

Best Answer

Wow, I think I may have at least found a workaround fix. I went to system monitor found the Gnome shell and killed it...

One of the Gnome shells was not accessible to me so I killed the other one. Once I did, I could see my two monitors flash and then my mouse started working again and I could click the Gnome task bar items again. This is odd, but I thought I'd at least document it. Gnome version 3.36.3

system monitor

EDIT - My Attempt to Explain How I Get Into This State

I can recreate the problem with the following steps...

  1. remmina is running (i'm connected to remote desktop that swallows keyboard commands)
  2. I attempt to take screenshot when over the remote (remmina) window using the following command => $ gnome-screenshot -acf /home/fakepath/Pictures/1.png &

Note: I have a keyboard shortcut that fires the gnome-screenshot command (when I'm floating over the Remmina window that also attempts to grab the keyboard input) I believe this is the issue, because my cursor gets changed into a cross-hair (waiting for the screen grab) but I can never take the screen-grab.

Notice the script runs as a background process. When I accidentally do this I get into that odd extra shell state and I cannot click the taskbar.

Update

This occurred again today when I was running Remmina and I had to go to System Monitor and kill the gnome-shell so my clicks would be recognized again. But I noticed an additional thing: When I kill the gnome-shell Remmina is also stopped. My Remmina remote desktop windows close.

Not casting aspersions upon Remmina because it is a great program, just attempting to add info to see if someone with more info sees the issue and is able to fix it.