Basically the code uses KWindowSystem::currentDesktop()[1] to check which virtual desktop you're on, and if there is a Kate instance running there already open the file in it, and if there isn't it starts a new instance then open the file with it. The issue is that on Wayland currentDesktop() always returns 0, so the logic doesn't work, opening a file with Kate could end up opening that file on an instance that's already running on a different virtual desktop. [1]https://invent.kde.org/utilities/kate/-/blob/master/kate/main.cpp#L407
I would consider this more an issue of the kwayland-integration. Or is there some replacement function for this?
The fix will probably have to be somewhere in kwayland*, then we can use it in Kate.
As of right now upstream Wayland has no concept of virtual desktops. That means that the existing virtual desktops in e.g. Plasma are completely compositor-defined and applications generally have no information about what desktop they are on. There may or may no come a Wayland protocol that allows this in the future, but as of right now this part of KWindowSystem can't reasonably be implemented on Wayland. That's why https://invent.kde.org/frameworks/kwindowsystem/-/merge_requests/72 renames it to make this explicit
I don't know much about Wayland; so here is an observation, assuming there is a kate instance on the current virtual desktop, and focus stealing prevention is set to none: - Ctrl+Clicking in konsole opens the file in that kate instance and activates the window - From that konsole window, using `kate /path/to/some/file`, the file is opened in kate, but the window isn't activated, and the task manager highlights the kate window as requesting attention