On Ubuntu 18.04, using Cinnamon, with a Logitech Performance MX mouse, the cursor will be focused on the wrong window despite another window being on top of it, in focus. When I try to click in the window that's on top, my clicks register in the behind window the focus is still trapped in. This most frequently happens when alt-tabbing between windows, but the behavior seems to be mostly at random. I'm not able to fully confirm this but it seems the keyboard is also affected during these episodes.
When this happens, I'm left with nothing to do except wait for the window to focus correctly. My clicks do not register at all in the correct window. I try to alt-tab between windows to focus one of them, but the focus is still trapped in the sticky window. It's like Ubuntu itself is slow to register when I'm changing my windows.
This is not a problem with the mouse itself. It appears to be something wrong with the way the windows themselves are managed. Restarting Cinnamon does nothing to fix it; opening up the TTY and closing out of it sometimes solves the problem for a little while before it starts again.
I already have prevent focus stealing on in the window settings, and changing the window focus mode to "sloppy" and "mouse" did nothing to change it.
On top of this, during one particular trapped-mouse moment, my taskbar disappeared completely for about a minute. When the taskbar returned, the mouse was still stuck.
E: Guessing it may have been a driver issue, I updated my NVIDIA driver to no avail. This problem happens even with a single window open, where the focus should be on the window but is stuck on the desktop. Is there any reason why the window focus manager would be so broken like this?
E2: I tried a different mouse (a Logitech G203) and, to my shock-horror, the problem appears to be resolved. No idea why my MX, which worked reliably for months, would suddenly start having such a strange problem. I doubt that the core issue has gone away, but for now I can use my PC again.
E3: After testing the suspected mouse on another computer I can say with certainty it was a problem with the mouse. No idea why.