Since searching for this issue with links not raising the window in google is resulting in this post coming up, I want to add some important information.
By default, wayland does not allow windows to just put themselves into arbitrary z positions.
However, to facilitate exactly this scenario of having web links or other items pop up the appropriate window, a protocol was added to Wayland to handle this.
This protocol is the XDG activation token: wayland.app/protocols/xdg-activation-v1
Fortunately, both Firefox and Chromium bases browsers already support this protocol as of the beginning of this year.
“But then why doesnt the browser raise when links are clicked?”
Therein lies the gotcha.
Each application must explicitly build in support for this new wayland protocol and pass it to the compositor to handle. Some programs, like Thunderbird, KDE 6.1 and Telegram, have already implemented this and will raise web browser windows when you click links. Others, like Discord, have not implemented this yet by default.
For KDE Specifically, you may be able to force it in the case of Discord and some other apps by adding the variable XDG_ACTIVATION_TOKEN=kwin-1
before the program you’re trying to launch in the terminal. In some cases, this may provided a workaround, but not guaranteed.
Ultimately, each individual app needs to support this protocol upstream and have their own activation tokens to avoid raising the incorrect windows.