[Solved] Cursor hide event freezes entire desktop
For about a month or so, after having done a full system upgrade, I've had a very annoying issue where any application that hides or unhides the cursor causes some component of my system to freeze. The freeze appears to be longer and happen a lot more frequently if the mouse cursor FPS is lower (happened after I killed picom and started it again).
Affected applications: Any that use cursor hide event (mpv, Firefox, Talos Principle 2,...).
It goes like this: Application causes cursor hide event, display (X11) freezes for 2 or so seconds, cursor hides, display freezes for 2 more seconds. If anything was being written as the cursor hide event happened, the first character is written twice.
In the case of mpv, it freezes, and this is written in STDOUT:
Audio device underrun detected.
Audio device underrun detected.
Audio device underrun detected.
Audio device underrun detected.
Audio/Video desynchronisation detected! Possible reasons include too slow
hardware, temporary CPU spikes, broken drivers, and broken files. Audio
position will not match to the video (see A-V status field).
Audio device underrun detected.
Audio device underrun detected.
In the case of Firefox, typing in any text field, such as the Search bar, freezes it as described.
In the case of Talos Principle 2, the game becomes almost unplayable as any opening of the pause menu, tab menu, dialogues, or anything else that uses the hide/unhide events (it happens really frequently) freezes the game.
I ruled out the possibility that it was due to the window manager (Qtile) by trying another (bspwm) and due to the compositor (picom) by temporarily killing it.
I am using a USB mouse/keyboard and AMD graphics card, Mesa drivers.
Can you please help me diagnose and fix this issue? It has been driving me crazy, and left me with an unplayable game on launch solely because I couldn't diagnose this issue myself.