Add option to do nothing when activating window on another desktop

Some users prefer this over the existing options. It e.g. allows to open
a bunch of links and only then switch to the browser on a different desktop

BUG: 464283
This commit is contained in:
Nicolas Fella 2023-01-15 23:12:30 +01:00
parent 653681ac40
commit 8c9c45b8f1
5 changed files with 22 additions and 1 deletions

View file

@ -1190,6 +1190,18 @@ Choose this option if you would like windows to always open on the current Virtu
</listitem>
</varlistentry>
<varlistentry>
<term><guilabel>Do nothing</guilabel></term>
<listitem>
<para>
The window stays on the desktop it currently is and the current desktop doesn't change.
</para>
<para>
Choose this option if you would like to keep the windows and desktops as they are.
</para>
</listitem>
</varlistentry>
</variablelist>
</sect3>

View file

@ -296,6 +296,8 @@ void Workspace::activateWindow(Window *window, bool force)
case Options::ActivationDesktopPolicy::BringToCurrentDesktop:
window->enterDesktop(VirtualDesktopManager::self()->currentDesktop());
break;
case Options::ActivationDesktopPolicy::DoNothing:
break;
}
--block_focus;
}

View file

@ -169,6 +169,11 @@
<string>Bring window to current Virtual Desktop</string>
</property>
</item>
<item>
<property name="text">
<string>Do nothing</string>
</property>
</item>
</widget>
</item>
</layout>

View file

@ -136,6 +136,7 @@
<choices name="KWin::Options::ActivationDesktopPolicy">
<choice name="SwitchToOtherDesktop"/>
<choice name="BringToCurrentDesktop"/>
<choice name="DoNothing"/>
</choices>
<default>KWin::Options::ActivationDesktopPolicy::SwitchToOtherDesktop</default>
</entry>

View file

@ -360,7 +360,8 @@ public:
enum ActivationDesktopPolicy {
SwitchToOtherDesktop,
BringToCurrentDesktop
BringToCurrentDesktop,
DoNothing,
};
Q_ENUM(ActivationDesktopPolicy)