How can I set plasma to automatically switch to virtual desktop where a window needs focus?

Basically, I’m facing the same issue as this reddit post:

I’m using Kali Linux with KDE Plasma and I would like to know if there’s a way to configure Plasma to switch focus to another Virtual Desktop when I click on a notification from an app that’s on this other virtual desktop. Or even, if I click on a link, to switch focus to the virtual desktop where the browser is.
Currently, I can see on the taskbar that the other app has the focus, but the virtual desktop doesn’t switch automatically.

There’s only one comment saying to switch focus stealing prevention to “none”, but that doesn’t work.

It works fine if both applications/windows are on the same virtual desktop, but when they’re in different ones I need to manually switch to the right desktop.

Is there any way to achieve this?

Hi - just to double-check, have you already adjusted the setting under System Settings > Window Management > Window Behavior > Advanced > Virtual Desktop behavior to “Switch to that Virtual Desktop”?

This is indeed turned on.

Also, I just noticed that this behaviour seems somewhat inconsistent. For instance, if I click on a link for a theme from within the settings app, it does switch to the virtual desktop where I had my default web browser open. Clicking on a link from my mail app though (protonmail) doesn’t.

From my very little testing, it seems to work (aka switch to the right virtual desktop) when the link that was clicked on comes from an app that’s a part of kde plasma, and doesn’t work when the app is external.