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
master
Nicolas Fella 2 years ago
parent 653681ac40
commit 8c9c45b8f1

@ -1190,6 +1190,18 @@ Choose this option if you would like windows to always open on the current Virtu
</listitem> </listitem>
</varlistentry> </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> </variablelist>
</sect3> </sect3>

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

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

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

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

Loading…
Cancel
Save