Bug 438375 - Don't switch to a different workspace when opening an application
Summary: Don't switch to a different workspace when opening an application
Alias: None
Product: kwin
Classification: Plasma
Component: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR wishlist with 2 votes (vote)
Target Milestone: ---
Assignee: KWin default assignee
Depends on:
Reported: 2021-06-09 23:31 UTC by Natalie Clarius
Modified: 2022-08-31 18:57 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.26


Note You need to log in before you can comment on or make changes to this bug.
Description Natalie Clarius 2021-06-09 23:31:46 UTC

1. Be on Workspace 1.
2. Have program A not open on Workspace 1 but open on Workspace 2.
3. Open program A, for example by clicking a launcher icon or opening a file.

The desktop switches to Workspace 2.
As someone with a similar issue put it, "it's the equivalent of picking up an object and being teleported to a different room".

Program A opens on Workspace 1, i.e. where it was invoked .
This would either be a new window (if the application can handle multiple instances) or with the existing window moved from WS2 to WS1 (if it is a single-instance application).

Operating System: Arch Linux
KDE Plasma Version: 5.22.0
KDE Frameworks Version: 5.82.0
Qt Version: 5.15.2
Kernel Version: 5.12.9-arch1-1 (64-bit)

I find it quite disrupting to open a file on one workspace and suddenly end up on a different one. I would assume that it is the expected behavior for the average user to have the program appear on the workspace it is called from, or at least to have the option to configure the behavior such.

I do have my task switcher filtered to the current desktop in the window behavior settings. Focus stealing prevention doesn't seem to be the right setting category either. 

XFCE has this setting: https://unix.stackexchange.com/a/98432/406769 "When window raises itself, bring window to current workspace" This is exactly what I would like to KDE.
Comment 1 Nate Graham 2022-08-31 18:57:27 UTC
Git commit 6b38b0372443b49246b2313673efb0e48a63a978 by Nate Graham, on behalf of Natalie Clarius.
Committed on 31/08/2022 at 18:57.
Pushed by ngraham into branch 'master'.

Add new option for behavior when window on different desktop is activated
When a window that is on a different virtual desktop than the current one gets
activated, the current behavior is that the active virtual desktop will be switched
to the one the activated window is on. This may seem reasonable for a scenario where
the user explicitly intends to activate an existing window on a different desktop.
However, the following scenario is also (perhaps even more?) common: When an
application responds to a launch command by requesting to activate an existing
instance instead of opening a new one (such as Firefox or KDE System Settings), an
existing window on any desktop will get activated even when what the user had in
mind was opening a new window (on the desktop they are currently in). 

This means that opening an application, such as following a URL or accessing a
system setting, unexpectedly results in the user being teleported to a different
virtual desktop. This can be very irritating. The more expected behavior for these
users would be to have windows always open on the desktop where they are called
from. That's is what this commit adds as a new option.
FIXED-IN: 5.26

M  +17   -2    doc/windowbehaviour/index.docbook
M  +8    -1    src/activation.cpp
M  +36   -2    src/kcmkwin/kwinoptions/advanced.ui
M  +8    -0    src/kcmkwin/kwinoptions/kwinoptions_settings.kcfg
M  +3    -0    src/kcmkwin/kwinoptions/windows.cpp
M  +7    -0    src/kwin.kcfg
M  +11   -0    src/options.cpp
M  +19   -0    src/options.h