SUMMARY *** NOTE: If you are reporting a crash, please try to attach a backtrace with debug symbols. See https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports *** STEPS TO REPRODUCE 1. Go to System Settings -> Window Management -> Window Behavior -> Advanced -> Virtual Desktop behavior 2. Choose either "Switch to that Virtual Desktop" or "Bring window to current Virtual Desktop" 3. Both options result in "Bring window to current Virtual Desktop" OBSERVED RESULT Selection "Switch to that Virtual Desktop" does not work. The activated windows is moved to current Virtual Desktop EXPECTED RESULT The current Virtual Desktop should switch to the Desktop with the activated window SOFTWARE/OS VERSIONS Linux/KDE Plasma: openSUSE Tumbleweed 20221221 / 5.26.4 (available in About System) KDE Plasma Version: 5.26.4 KDE Frameworks Version: 5.101.0 Qt Version: 5.15.7 ADDITIONAL INFORMATION
Works fine for me. What application are you testing? Please give exact steps for what you are doing
Thanks for checking! Let's say I have Firefox running in "Virtual Desktop 1" and Thunderbird in "Virtual Desktop 2". Now I click a link in Thunderbird which will be opened by Firefox. When I opt with "Bring window to current Virtual Desktop" I'd expect that my view stays in "Virtual Desktop 2" and Firefox will be moved from "Virtual Desktop 1" to"Virtual Desktop 2" With option "Switch to that Virtual Desktop" I'd expect that my view switches to "Virtual Desktop 1". But on my system with both options Firefox will be moved from "Virtual Desktop 1" to"Virtual Desktop 2"
If it only affects Firefox, it's probably a duplicate of https://bugs.kde.org/show_bug.cgi?id=462996 Or can you confirm it with any other applications?
Correction: It works fine for me on Wayland. On X11 it seems to be as you described. Tested with Firefox and Neochat
I think I see the problem. On X11 when an application is activated it sends a startup id. This startup ID optionally contains a desktop number that hints to the window manager where the app should be started on. For apps started from Plasma this will be the current desktop: https://invent.kde.org/frameworks/kio/-/blob/master/src/gui/kprocessrunner.cpp#L277 When KWin receives this id it checks the desktop number and falls back to the current desktop. Then it sends the window to that desktop: https://invent.kde.org/plasma/kwin/-/blob/master/src/activation.cpp#L775 Only later in the code we get to the point where we check the desktop switch behavior setting: https://invent.kde.org/plasma/kwin/-/blob/master/src/activation.cpp#L290. At this point the window is already on the current desktop, so the whole thing doesn't trigger at all. The first half of this only happens on X11, which explains why it works on Wayland
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/3380
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kio/-/merge_requests/1097
*** This bug has been marked as a duplicate of bug 462996 ***
(In reply to Nicolas Fella from comment #5) > I think I see the problem. > > On X11 when an application is activated it sends a startup id. This startup > ID optionally contains a desktop number that hints to the window manager > where the app should be started on. For apps started from Plasma this will > be the current desktop: > https://invent.kde.org/frameworks/kio/-/blob/master/src/gui/kprocessrunner. > cpp#L277 > > When KWin receives this id it checks the desktop number and falls back to > the current desktop. Then it sends the window to that desktop: > https://invent.kde.org/plasma/kwin/-/blob/master/src/activation.cpp#L775 > > Only later in the code we get to the point where we check the desktop switch > behavior setting: > https://invent.kde.org/plasma/kwin/-/blob/master/src/activation.cpp#L290. At > this point the window is already on the current desktop, so the whole thing > doesn't trigger at all. > > The first half of this only happens on X11, which explains why it works on > Wayland Thank you for this quick find!