Window Focus Becomes Erratic At Seemingly Random Times
(Somewhat) Relevant Machine Specifications: OS: Debian 12 (Bookworm, which is in Testing, which I think is in soft freeze) Architecture: amd64 Motherboard: Aorus AX370 Gaming 5 (This is a Desktop Machine) Memory: 32 GB (Just to make it clear it's not a memory overflow or the like. Applications that function run at full performance.) Input Devices: Logitech M510 Mouse, Logitech K350 Keyboard, and sometimes a no-name mouse and keyboard to control a VM. Kernel: 6.1.20 XFWM Version: 4.18.0 revision 7e7473c5 (Although seems to have started some time around the introduction of the 4.18 desktop in general) XFCE4 Panel Version: 4.18.2 Graphics: AMD Radeon RX 550 (Connected to Display), AMD Radeon RX 580 (I passthrough this GPU to VMs or sometimes use DRI_PRIME. It's usually not in use when the issue occurs, but a sufficient oddity to mention.)
Seemingly randomly, while using the desktop, window focus starts to become erratic. Usually, the problem starts when I try to use the Whisker Menu. It will not accept input, and one window seems to be stealing the focus, sometimes Firefox, sometimes XFCE4 terminal. Windows can no longer be dragged, and some don't accept mouse input, and others keyboard input. I try to restart both the window manager and the panel, to no avail. I will try to get dmesg ouput to you shortly when the problem comes up again, but I have tried in vain to troubleshoot this many times, usually not seeing anything of relevance.
These are the applications and major processes usually running when the problem occurs (but not always): Amazon Music in Wine, Firefox ESR in firejail, VSCodium (It's just a deblobbed VSCode, which is an electron app), XFCE terminal, and redshift (night mode). I've sometimes suspected it to be Amazon Music, but the bug sometimes comes up even when it is not open.
Usually, I just end up going into a tty and restarting lightdm, which resets the desktop as well.
This looks similar in some respects to #632 and could be the same issue, but they were starting to come to the conclusion it might be an issue with their trackpad kernel driver, so for now, I am putting this as a distinct issue.
Thank you for your time. Let me know if I need to give more information.