Task switcher not defocusing from app

Let’s say I have two Emacs windows open and I press “Alt + caret” to switch between them. I hold down Alt, press the caret key, and see the task switcher menu with two instance of Emacs. Now, I keep holding down Alt but when I press caret again it prints ` in my Emacs window. The task switcher menu is still open as long I hold down Alt and each time I press the caret key it highlights a different instance of Emacs. But each time it also sends the ` key press to my Emacs window which is unwanted. It’s as if it’s not properly defocusing from Emacs while I’m using the task switcher widget. It didn’t realize this at first and only later started wondering why my code contains random ` symbols here and there.

Is the problem clear? I see similar behavior when pressing Alt + Tab and not just with Emacs but also other applications.

As a follow up, it is clear that the task switcher is not defocusing from non-KDE apps. For instance, if my focus is on Konsole and I start pressing Alt + Tab or Alt + caret, I can see the cursor changing (from black to a hollowed out rectangle). But if my focus is on Emacs and I press Alt + Tab, the cursor in the Emacs window keeps blinking. As I hold down Alt and press Tab or caret one or more times, the same key is also sent to the Emacs window.

Is the task switcher part of Kwin and should I investigate some recent Kwin commits or how would I go about debugging this?

This also happens with VSCode, try this option:

Wow, thanks a lot!
It seems to work for now and I don’t see any side effects.