STEPS TO REPRODUCE 1. Have two virtual desktops 2. Take some app that opens URLs and has support for xdg-activation (e.g. Neochat) and a browser that supports xdg-activation (e.g. Angelfish) 3. Open both apps on Desktop 1 4. Move Angelfish to Desktop 2 via the task manager 5. Click on a link in Neochat OBSERVED RESULT A bouncing cursor with the Angelfish icon. The URL is opened in Angelfish, but the desktop doesn't switch to desktop 2 EXPECTED RESULT Virtual desktop 2 is now the current desktop SOFTWARE/OS VERSIONS KDE Plasma Version: master KDE Frameworks Version: master Qt Version: 5.15.5-kde ADDITIONAL INFORMATION Wayland When Angelfish was launched on desktop 2 it switches correctly When switching to desktop 2 after Angelfish was moved and switching back to desktop 1 it works correctly
xdg-activation integration code uses Workspace::activateWindow(), so it should change the current desktop.
It actually would be nice to add some tests.
Works as expected with https://invent.kde.org/plasma/kwin/-/blob/master/tests/xdgactivationtest-qt5.cpp. Can you attach wayland debug log of angelfish?
What focus stealing prevention level do you have set?
FSP plays no role on Wayland
I found that the isExposed() check in https://invent.kde.org/frameworks/kwindowsystem/-/blob/master/src/kwindowsystem.cpp#L455 is false and thus no activate call is made
xdgactivationtest-qt5 does work as expected indeed
(In reply to Nicolas Fella from comment #6) > I found that the isExposed() check in > https://invent.kde.org/frameworks/kwindowsystem/-/blob/master/src/ > kwindowsystem.cpp#L455 is false and thus no activate call is made Removing that check makes it work as expected
Weird. I believe isExposed() check is needed to ensure that there's wl_surface. But maybe it is safe to remove that and let kwayland-integration handle that. In fact it already does that https://invent.kde.org/plasma/kwayland-integration/-/blob/bc7509672153434a8ae6f8f5eec8bc1806644303/src/windowsystem/windowsystem.cpp#L43 Regardless, it makes sense to remove that check
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kwindowsystem/-/merge_requests/61
Git commit acf85e40ff6fa14d90cffe6107f188c85b03d244 by Vlad Zahorodnii. Committed on 13/09/2022 at 06:26. Pushed by vladz into branch 'master'. Remove QWindow::isExposed() check in activateWindow() A window can be considered as unexposed if it's not visible, e.g. it's minimized or not on current virtual desktop. The isExposed() check neuters the desired side-effects of the activateWindow() request. As far as I understand, QWindow::isExposed() check was added to ensure that there's wl_surface, but kwayland-integration noops if the wl_surface is missing. Co-authored: Nicolas Fella <nicolas.fella@gmx.de> M +0 -4 src/kwindowsystem.cpp https://invent.kde.org/frameworks/kwindowsystem/commit/acf85e40ff6fa14d90cffe6107f188c85b03d244